Returns the handle of the row which is displayed at the specified position.
NuGet Package: DevExpress.Win.Grid
public virtual int GetVisibleRowHandle( int rowVisibleIndex )
Public Overridable Function GetVisibleRowHandle( rowVisibleIndex As Integer ) As Integer
An integer value specifying the row’s visible index.
An integer value representing the corresponding row handle. Row handles are not data source indexes, see the Accessing Rows in Code. Row Handles section of the “Rows” article for more information. The GridControl.InvalidRowHandle value is returned if an invalid index is passed as the parameter.
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
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 GetVisibleRowHandle member must not be invoked for these Views. The GetVisibleRowHandle member can only be used with Views that display real data within the Grid Control. Use the following methods to access these Views with which an end user interacts at runtime.
- 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.