Skip to main content

IRelationList.RelationCount Property

When implemented by a class, returns the number of master-detail relationships for the current master data source.

Namespace: DevExpress.Data

Assembly: DevExpress.Data.v24.1.dll

NuGet Package: DevExpress.Data

Declaration

int RelationCount { get; }

Property Value

Type Description
Int32

An integer value that specifies the number of master-detail relationships for the current master data source.

Remarks

This property returns the number of master-detail relationships for a master data source. If it’s set to 0, master-detail mode is disabled.

If using the IRelationListEx interface instead of the IRelationList, you can provide a different number of relationships for different rows by overriding the IRelationListEx.GetRelationCount method.

When implementing a data source for a GridControl, if the RelationCount property is set to a value greater than 0, the grid enables master-detail mode. In this case, each master row displays an expand button, which allows end-users to access the detail data. To hide the expand buttons, set the GridOptionsView.ShowDetailButtons property to false. If you need to disable master-detail mode in a Grid View regardless of the data source’s settings, you can use a master View’s GridOptionsDetail.EnableMasterViewMode property.

See Also