Returns the visible index of the row specified by its handle.
public virtual int GetVisibleIndex( int rowHandle )
Public Overridable Function GetVisibleIndex( rowHandle As Integer ) As Integer
An integer value representing the row’s handle.
An integer value representing the specified record’s visible index. -1 if the specified record is hidden within a collapsed group (in Grid Views).
Visible indexes reflect the order in which data records, group rows, the auto filter row and the new item row are displayed within a View (the auto-filter row and group rows are supported only in Grid Views and their descendants). In Grid Views, rows can be hidden within collapsed groups. These rows are not indexed.
Data row handles start from zero and specify the order in which rows are displayed within a View. Group row handles are negative and start from -1. If grouping is not applied, row handles and visible indexes match.
To obtain the handle of a row by its visible index, use the ColumnView.GetVisibleRowHandle method.
The following image illustrates row handles and the corresponding visible indexes for a sample Grid View in group mode.
In this example, it’s assumed that the “City: Salzburg” group row contains two nested data rows. So the bottom-most data row (“Ipoh Coffee - 30 - $1,104.00”) has the row handle equal to 4, not 2.
See the Accessing Rows in Code. Row Handles section in the Rows topic to learn more.
Detail pattern Views do not contain data and they are never displayed within XtraGrid. So, the GetVisibleIndex member must not be invoked for these Views. The GetVisibleIndex 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.