GridView.GetRelationIndex(Int32, String) Method
Gets the index of the specified relationship for the specified master row.
public virtual int GetRelationIndex( int rowHandle, string relationName )
Public Overridable Function GetRelationIndex( rowHandle As Integer, relationName As String ) As Integer
An integer value specifying the master row handle.
A string identifying the name of the required relationship.
An integer representing the zero-based index of the specified relationship; -999999 if a relationship with the specified name is not found.
The number of relations for a particular row is determined by the GridView.GetRelationCount method. The GetRelationIndex method returns a value between 0 and GetRelationCount-1 and this defines the specified relationship's index amongst the other relationships. The indexes define the order in which detail Views are displayed for particular master rows.
To get the name of a relationship by its index, the GridView.GetRelationName method can be used.
Detail pattern Views do not contain data and they are never displayed within XtraGrid. So, the GetRelationIndex member must not be invoked for these Views. The GetRelationIndex 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.