DataViewBase.GetRowHandleByMouseEventArgs(MouseEventArgs) Method
In This Article
Returns the handle of a row located under the mouse pointer.
Namespace: DevExpress.Xpf.Grid
Assembly: DevExpress.Xpf.Grid.v14.2.Core.dll
#Declaration
#Parameters
Name | Type | Description |
---|---|---|
e | Mouse |
A Mouse |
#Returns
Type | Description |
---|---|
Int32 | An integer value that specifies the handle of the row located under the mouse pointer. |
#Remarks
The following example shows how to obtain which row has been clicked.
private void grid_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e) {
int rowHandle = grid.View.GetRowHandleByMouseEventArgs(e as System.Windows.Input.MouseButtonEventArgs);
MessageBox.Show(GetRowType(rowHandle), "Hit Info", MessageBoxButton.OK);
}
private string GetRowType(int rowHandle) {
if (grid.IsGroupRowHandle(rowHandle))
return "Group Row";
if (rowHandle == GridControl.AutoFilterRowHandle)
return "Automatic Filter Row";
if (rowHandle == GridControl.NewItemRowHandle)
return "New Item Row";
if (rowHandle == GridControl.InvalidRowHandle)
return "Invalid Row";
return "Data Row";
}
To learn more, see Obtaining Row Handles.
See Also