Skip to main content

GridView.GetRelationCount(Int32) Method

Returns the number of relations for a particular master row.

Namespace: DevExpress.XtraGrid.Views.Grid

Assembly: DevExpress.XtraGrid.v23.2.dll

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

Declaration

public virtual int GetRelationCount(
    int rowHandle
)

Parameters

Name Type Description
rowHandle Int32

An integer value specifying the master row handle.

Returns

Type Description
Int32

An integer value indicating the number of relations for the specified master row.

Remarks

A View can have details if it is bound to a DataTable that has child relations or to a data source created at runtime implementing the IRelationList interface. In these cases, the GetRelationCount method returns the same value for any master row. The return value is specified by the bound data source. Note that you may also supply detail data dynamically by handling the GridView.MasterRowEmpty, GridView.MasterRowGetChildList, GridView.MasterRowGetRelationCount and GridView.MasterRowGetRelationName events. In this case, master rows can have a different number of details. The number of details for a particular master row is specified by the GridView.MasterRowGetRelationCount event handler.

Note

Detail pattern Views do not contain data and they are never displayed within XtraGrid. So, the GetRelationCount member must not be invoked for these Views. The GetRelationCount member can only be used with Views that display real data within the Grid Control. Use the following methods to access these Views with which an end user interacts at runtime.

See Also