Skip to main content
.NET Standard 2.0+

IndexAttribute Class

Specifies the target business class property’s order index, that will be considered when generating layout items in a Detail View, and columns in a List View.

Namespace: DevExpress.Persistent.Base

Assembly: DevExpress.ExpressApp.v22.1.dll


[AttributeUsage(AttributeTargets.Property, Inherited = false, AllowMultiple = false)]
public class IndexAttribute :


Apply the Index attribute to business class properties, to specify the order by which they will be added to the property list used to arrange corresponding layout items in a Detail View, and columns in a List View. To set the required index, pass it as the attribute’s index parameter. When generating the Application Model‘s nodes, the index specified via this attribute will be assigned to the appropriate BOModel | <Class> | OwnMembers | <Member> node’s IModelNode.Index property.

The property list that is used to arrange corresponding layout items in a Detail View and columns in a List View is populated in the following way. First, the properties that are indexed via the Index attribute are added in index order. Then, non-indexed properties are added in a particular order. In a List View, only the properties that are declared in the represented class are made visible, and arranged according to their order in the list. The inherited properties are made invisible (their Index property in the Application Model’s Views | <ListView> | Columns | <Column> node is set to -1). In a Detail View, the layout items corresponding to properties are grouped according to particular rules. These rules are fully detailed in the View Items Layout Customization topic. However, the order in which they follow in a group is determined by the order in which the corresponding properties are listed.

The following example demonstrates how the Index attribute influences the column order in a List View and the layout items order in a Detail View.

public class DomainObject1 : BaseObject {
    public DomainObject1(Session session) : base(session) { }
    public int Property1 {
        get { return GetPropertyValue<int>(nameof(Property1)); }
        set { SetPropertyValue<int>(nameof(Property1), value); }
    public int Property2 {
        get { return GetPropertyValue<int>(nameof(Property2)); }
        set { SetPropertyValue<int>(nameof(Property2), value); }
    public int Property3 {
        get { return GetPropertyValue<int>(nameof(Property3)); }
        set { SetPropertyValue<int>(nameof(Property3), value); }
    public int Property4 {
        get { return GetPropertyValue<int>(nameof(Property4)); }
        set { SetPropertyValue<int>(nameof(Property4), value); }
    public int Property5 {
        get { return GetPropertyValue<int>(nameof(Property5)); }
        set { SetPropertyValue<int>(nameof(Property5), value); }
public class DomainObject2 : DomainObject1 {
    public DomainObject2(Session session) : base(session) { }
    public int Property6 {
        get { return GetPropertyValue<int>(nameof(Property6)); }
        set { SetPropertyValue<int>(nameof(Property6), value); }
    public int Property7 {
        get { return GetPropertyValue<int>(nameof(Property7)); }
        set { SetPropertyValue<int>(nameof(Property7), value); }
    public int Property8 {
        get { return GetPropertyValue<int>(nameof(Property8)); }
        set { SetPropertyValue<int>(nameof(Property8), value); }

In the Detail and List Views of the DomainObject1 class, properties are arranged according to the indexes specified for them:



In the Detail View of the DomainObject2 class, inherited properties are grouped and arranged according to the indexes specified for them in the base class. The properties declared in the DomainObject2 class are combined in a separate group, within which they are arranged in the order they are added to the property list: first, indexed properties and then, non-indexed properties are displayed.


In the List View of the DomainObject2 class, properties follow each other according to the order they are added to the properties list: first, indexed properties and then, non-indexed properties are displayed. Inherited properties are made invisible.


Since Property Editors are automatically grouped according to specific rules, apply the Index attribute in code when you are sure that the target properties will be contained in the same group. For instance, if you index an unlimited string within the properties that will be represented by simple editors, the memo editor representing this string will be located in a separate group, irrespective of the index you specified.


See Also