[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
   Reporting
  [Collapse]Data Grid
   [Expand]Getting Started
   [Expand]Implementation Details
   [Expand]Views
   [Collapse]Grid View Data Layout
    [Expand]Columns and Card Fields
    [Expand]Bands
    [Collapse]Rows and Cards
      Identifying Rows and Cards
      Obtaining Row Handles
    [Expand]Nodes
     Data Cells
     Best Fit
     Compact Mode
   [Expand]Binding to Data
   [Expand]Master-Detail Data Representation
   [Expand]Data Editing and Validation
   [Expand]Grouping
   [Expand]Selection
   [Expand]Filtering and Searching
   [Expand]Sorting
   [Expand]Data Summaries
   [Expand]Paging and Scrolling
   [Expand]Focus and Navigation
   [Expand]Conditional Formatting
   [Expand]Drag-and-Drop
   [Expand]Appearance Customization
   [Expand]MVVM Enhancements
   [Expand]Printing and Exporting
   [Expand]End-User Interaction
   [Expand]Miscellaneous
   [Expand]Performance Improvement
   [Expand]Design-Time Features
   [Expand]Visual Elements
   [Expand]End-User Capabilities
   [Expand]Examples
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Printing-Exporting
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Gantt Control
  [Expand]Diagram Control
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Obtaining Row Handles

There are multiple methods that allow you to obtain row handles, visible indices and indices in a data source. This topic lists and describes these methods.

Expanded Obtaining Row Handles

Member Description
DataViewBase.FocusedRowHandle Specifies the focused row's handle if the DataViewBase.NavigationStyle property isn't set to GridViewNavigationStyle.None.
DataViewBase.GetRowHandleByMouseEventArgs Returns the handle of a row located under the mouse pointer.
DataViewBase.GetRowHandleByTreeElement Returns the handle of a row that contains the specified element.
GridControl.GetRowHandleByVisibleIndex Returns a row's handle by specifying its visible index.
GridControl.GetRowHandleByListIndex Returns a row's handle by specifying its index in a data source.
GridControl.GetListIndexByRowHandle Returns the specified data row's index in a data source.

The following example shows how to obtain which row has been clicked.

Expanded Obtaining Data Rows and Row Indices in a Datasource

Row handles and visible indices reflect the visual order of rows in a View, and these may change as rows change their positions or visibility. To refer to a particular row in a data source, you should use a list index (a row's index in a data source). To obtain a row's list index by specifying its handle, use the GridControl.GetRowListIndex method.

To obtain a row object that corresponds to a row with the specified handle, use the DataControlBase.GetRow, GridControl.GetRowAsync or GridControl.GetRowByListIndex method. To obtain the focused row, use the GridControl.GetFocusedRow method. Row objects represent records in a data source. For instance, a System.Data.DataRow object represents a record in a System.Data.DataTable.

Expanded See Also

Is this topic helpful?​​​​​​​