Returns the number of relations for a particular master row.
public virtual int GetRelationCount( int rowHandle )
Public Overridable Function GetRelationCount( rowHandle As Integer ) As Integer
An integer value specifying the master row handle.
An integer value indicating the number of relations for the specified master row.
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.
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.
- GridControl.MainView - returns the top most View in a grid;
- GridControl.FocusedView - returns the focused View;
- GridControl.DefaultView - returns the currently maximized View;
- the sender parameter of View specific events;
- GridView.GetDetailView - returns a detail clone View for a specific master row.