A newer version of this page is available. Switch to the current version.

GridView.DefaultRelationIndex Property

Gets or sets the value indicating which detail level is processed by default.

Namespace: DevExpress.XtraGrid.Views.Grid

Assembly: DevExpress.XtraGrid.v19.2.dll

Declaration

[DXCategory("Behavior")]
[DefaultValue(0)]
public virtual int DefaultRelationIndex { get; set; }
<DXCategory("Behavior")>
<DefaultValue(0)>
Public Overridable Property DefaultRelationIndex As Integer

Property Value

Type Default Description
Int32

0

A zero-based integer representing the relation index processed by default.

Remarks

Views can have several detail levels. This means that each master row can have several associated detail clones. The DefaultRelationIndex property identifies the level whose corresponding detail clones are accessed by default. Thus, it identifies which detail clone should be opened when expanding a master row by clicking the master-detail expand button, pressing the "+" key, etc.

Additionally, the property determines the relation index processed by the GridView.IsMasterRowEmpty, GridView.SetMasterRowExpanded, and GridView.CanExpandMasterRow methods.

To access a particular master row's detail, you should use the GridView.IsMasterRowEmptyEx, GridView.SetMasterRowExpandedEx, GridView.GetMasterRowExpandedEx, and GridView.CanExpandMasterRowEx methods instead. Calling the latter methods with the DefaultRelationIndex property value as the parameter provides the same result as the other methods mentioned.

Please refer to the Master-Detail Relationships and Master-Detail Relationships topics for additional information.

See Also