Back to Devexpress

IRelationList.RelationCount Property

corelibraries-devexpress-dot-data-dot-irelationlist.md

latest2.6 KB
Original Source

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

NuGet Package : DevExpress.Data

Declaration

csharp
int RelationCount { get; }
vb
ReadOnly Property RelationCount As Integer

Property Value

TypeDescription
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

Working with Master-Detail Relationships in Code

IRelationList Interface

IRelationList Members

DevExpress.Data Namespace