GridView.GetRelationCount(Int32) Method

Returns the number of relations for a particular master row.

Namespace: DevExpress.XtraGrid.Views.Grid

Assembly: DevExpress.XtraGrid.v20.1.dll

Declaration

public virtual int GetRelationCount(
    int rowHandle
)
Public Overridable Function GetRelationCount(
    rowHandle As Integer
) As Integer

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 real Views that are displayed within the Grid Control. The real Views with which an end-user interacts at runtime can be accessed using the following methods.

See Also