Back to Devexpress

GridHitInfo.RowHandle Property

windowsforms-devexpress-dot-xtragrid-dot-views-dot-grid-dot-viewinfo-dot-gridhitinfo-bd1dcb1f.md

latest6.0 KB
Original Source

GridHitInfo.RowHandle Property

Gets or sets the handle of the row located under the test point.

Namespace : DevExpress.XtraGrid.Views.Grid.ViewInfo

Assembly : DevExpress.XtraGrid.v25.2.dll

NuGet Packages : DevExpress.Win.Grid, DevExpress.Win.Navigation

Declaration

csharp
public int RowHandle { get; set; }
vb
Public Property RowHandle As Integer

Property Value

TypeDescription
Int32

An integer value that specifies the handle of the row located under the test point. The GridControl.InvalidRowHandle value if the test point doesn’t belong to any row.

|

Remarks

See Rows, to learn about row handles.

The following code snippets (auto-collected from DevExpress Examples) contain references to the RowHandle property.

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.

winforms-grid-move-cell-using-drag-drop/CS/Classes/GridViewHelper.cs#L50

csharp
{
    object val = (view as GridView).GetRowCellValue(gridHI.RowHandle, gridHI.Column);
    if (val == null || val.ToString() == string.Empty) return;

winforms-grid-enable-editing-in-group-row-to-change-cell-values/CS/WindowsApplication3/GroupEditProvider.cs#L94

csharp
GridHitInfo hitInfo = view.CalcHitInfo(e.Location);
if (hitInfo.HitTest == GridHitTest.Row && view.IsGroupRow(hitInfo.RowHandle))
{

winforms-grid-multiple-row-selection-web-style-checkboxes/CS/E1271/CheckMarkSelection.cs#L222

csharp
if(info.InRowCell) {
    InvertRowSelection(info.RowHandle);
}

winforms-grid-select-rows-using-mouse-without-ctrl/CS/MultiSelectionHelper.cs#L47

csharp
}
_GridView.FocusedRowHandle = hi.RowHandle;
_GridView.FocusedColumn = hi.Column;

winforms-grid-multi-cell-editing/CS/MultiSelectionEditingHelper.cs#L33

csharp
GridHitInfo hi = view.CalcHitInfo(e.Location);
if (view.FocusedRowHandle == hi.RowHandle)
{

winforms-grid-move-cell-using-drag-drop/VB/Classes/GridViewHelper.vb#L44

vb
If gridHI.HitTest = GridHitTest.RowCell Then
    Dim val As Object = (TryCast(view, GridView)).GetRowCellValue(gridHI.RowHandle, gridHI.Column)
    If val Is Nothing OrElse val.ToString() = String.Empty Then

winforms-grid-enable-editing-in-group-row-to-change-cell-values/VB/WindowsApplication3/GroupEditProvider.vb#L94

vb
Dim hitInfo As GridHitInfo = view.CalcHitInfo(e.Location)
If hitInfo.HitTest = GridHitTest.Row AndAlso view.IsGroupRow(hitInfo.RowHandle) Then
    Dim viewInfo As GridViewInfo = TryCast(view.GetViewInfo(), GridViewInfo)

winforms-grid-multiple-row-selection-web-style-checkboxes/VB/E1271/CheckMarkSelection.vb#L260

vb
If info.InRowCell Then
    InvertRowSelection(info.RowHandle)
End If

winforms-grid-select-rows-using-mouse-without-ctrl/VB/MultiSelectionHelper.vb#L41

vb
_GridView.FocusedRowHandle = hi.RowHandle
_GridView.FocusedColumn = hi.Column

winforms-grid-multi-cell-editing/VB/MultiSelectionEditingHelper.vb#L30

vb
Dim hi As GridHitInfo = view.CalcHitInfo(e.Location)
If view.FocusedRowHandle = hi.RowHandle Then
    view.FocusedColumn = hi.Column

See Also

GridHitInfo Class

GridHitInfo Members

DevExpress.XtraGrid.Views.Grid.ViewInfo Namespace