wpf-devexpress-dot-xpf-dot-grid-dot-gridcontrol-dot-getrowhandlebyvisibleindex-x28-system-dot-int32-x29.md
Returns a row’s handle by its visible index.
Namespace : DevExpress.Xpf.Grid
Assembly : DevExpress.Xpf.Grid.v25.2.dll
NuGet Package : DevExpress.Wpf.Grid.Core
public int GetRowHandleByVisibleIndex(
int visibleIndex
)
Public Function GetRowHandleByVisibleIndex(
visibleIndex As Integer
) As Integer
| Name | Type | Description |
|---|---|---|
| visibleIndex | Int32 |
An integer value that specifies the row’s visible position within a View.
|
| Type | Description |
|---|---|
| Int32 |
An integer value that specifies the handle of the specified row (group or data).
|
The GetRowHandleByVisibleIndex method returns InvalidRowHandle if the specified row does not exist.
Refer to the following help topics for more information: Identify Rows and Cards and Obtain Row Handles.
The following code snippets (auto-collected from DevExpress Examples) contain references to the GetRowHandleByVisibleIndex(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.
wpf-data-grid-expand-and-collapse-master-rows/CS/WpfApplication21/MainWindow.xaml.cs#L32
for (int i = 0; i < grid.VisibleRowCount; i++) {
var rowHandle = grid.GetRowHandleByVisibleIndex(i);
grid.ExpandMasterRow(rowHandle);
wpf-data-grid-obtain-rows-visible-on-screen/CS/IScrollInfoSample/Window1.xaml.cs#L28
for (int i = grid.View.TopRowIndex; i < bottomIndex; i++) {
var handle = grid.GetRowHandleByVisibleIndex(i);
if (!grid.IsValidRowHandle(handle))
while(++i < this._Grid.VisibleRowCount) {
int rowHandle = this._Grid.GetRowHandleByVisibleIndex(i);
if(this._Grid.IsGroupRowHandle(rowHandle)) {
wpf-data-grid-expand-and-collapse-master-rows/VB/WpfApplication21/MainWindow.xaml.vb#L31
For i As Integer = 0 To Me.grid.VisibleRowCount - 1
Dim rowHandle = Me.grid.GetRowHandleByVisibleIndex(i)
Me.grid.ExpandMasterRow(rowHandle)
wpf-data-grid-obtain-rows-visible-on-screen/VB/IScrollInfoSample/Window1.xaml.vb#L29
For i As Integer = Me.grid.View.TopRowIndex To bottomIndex - 1
Dim handle = Me.grid.GetRowHandleByVisibleIndex(i)
If Not Me.grid.IsValidRowHandle(handle) Then Continue For
While Threading.Interlocked.Increment(i) < _Grid.VisibleRowCount
Dim rowHandle As Integer = _Grid.GetRowHandleByVisibleIndex(i)
If _Grid.IsGroupRowHandle(rowHandle) Then
See Also