Skip to main content

DataViewBase.GetRowHandleByMouseEventArgs(MouseEventArgs) Method

Returns the handle of a row located under the mouse pointer.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v23.2.Core.dll

NuGet Package: DevExpress.Wpf.Grid.Core


public int GetRowHandleByMouseEventArgs(
    MouseEventArgs e


Name Type Description
e MouseEventArgs

A MouseEventArgs object or its descendant, that contains data for mouse-related events.


Type Description

An integer value that specifies the handle of the row located under the mouse pointer.


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

private void TableView_MouseDown(object sender, MouseButtonEventArgs e) {
    int rowHandle = grid.View.GetRowHandleByMouseEventArgs(e as MouseEventArgs);
    MessageBox.Show(GetRowType(rowHandle), "Hit Info");
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