GridView.DefaultRelationIndex Property
Gets or sets the index of a detail view (detail tab) to process by default.
Namespace: DevExpress.XtraGrid.Views.Grid
Assembly: DevExpress.XtraGrid.v24.2.dll
Declaration
[DefaultValue(0)]
[DXCategory("Behavior")]
public virtual int DefaultRelationIndex { get; set; }
Property Value
Type | Default | Description |
---|---|---|
Int32 | 0 | A zero-based integer that specifies the index of a detail view processed by default. |
Remarks
Views can have multiple detail views. The DefaultRelationIndex
property specifies the index of a detail view (detail tab) to open when a user expands a master row.
/* The advBandedGridView1 view has two detail views: gridView1, cardView1.
* The following code makes the cardView1 the default detail view.
* The grid displays the corresponding detail tab when a user expands a master row.
*/
advBandedGridView1.DefaultRelationIndex = 1;
The DefaultRelationIndex
property specifies a detail view processed by the IsMasterRowEmpty(Int32), SetMasterRowExpanded, and CanExpandMasterRow(Int32) methods.
Use the following methods to expand/collapse or get the information about the specified detail view:
- SetMasterRowExpandedEx(Int32, Int32, Boolean)
- GetMasterRowExpandedEx(Int32, Int32)
- CanExpandMasterRowEx(Int32, Int32)
- IsMasterRowEmptyEx(Int32, Int32)
Read the following topic for detailed information: Master-Detail Relationships.