Back to Devexpress

GridView.DefaultRelationIndex Property

windowsforms-devexpress-dot-xtragrid-dot-views-dot-grid-dot-gridview-57069f36.md

latest3.8 KB
Original Source

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.v25.2.dll

NuGet Packages : DevExpress.Win.Grid, DevExpress.Win.Navigation

Declaration

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

Property Value

TypeDefaultDescription
Int320

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.

csharp
/* 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;
vb
' 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

EnableDetailToolTip

ShowDetailTabs

GridView Class

GridView Members

DevExpress.XtraGrid.Views.Grid Namespace