Skip to main content
A newer version of this page is available. .

GridView.GetRelationCount(Int32) Method

Returns the number of relations for a particular master row.

Namespace: DevExpress.XtraGrid.Views.Grid

Assembly: DevExpress.XtraGrid.v19.2.dll

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 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.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the GetRelationCount(Int32) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also