windowsforms-devexpress-dot-xtragrid-dot-views-dot-grid-dot-gridview-57069f36.md
Gets or sets the index of a detail view (detail tab) to process by default.
Namespace : DevExpress.XtraGrid.Views.Grid
Assembly : DevExpress.XtraGrid.v25.2.dll
NuGet Packages : DevExpress.Win.Grid, DevExpress.Win.Navigation
[DefaultValue(0)]
[DXCategory("Behavior")]
public virtual int DefaultRelationIndex { get; set; }
<DXCategory("Behavior")>
<DefaultValue(0)>
Public Overridable Property DefaultRelationIndex As Integer
| Type | Default | Description |
|---|---|---|
| Int32 | 0 |
A zero-based integer that specifies the index of a detail view processed by default.
|
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 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:
Read the following topic for detailed information: Master-Detail Relationships.
See Also