Back to Devexpress

RowCellCustomDrawEventArgs.RowHandle Property

windowsforms-devexpress-dot-xtragrid-dot-views-dot-base-dot-rowcellcustomdraweventargs-f6add6ff.md

latest6.5 KB
Original Source

RowCellCustomDrawEventArgs.RowHandle Property

Gets the handle of a painted element’s row.

Namespace : DevExpress.XtraGrid.Views.Base

Assembly : DevExpress.XtraGrid.v25.2.dll

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

Declaration

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

Property Value

TypeDescription
Int32

An integer value identifying the row that corresponds to the painted element.

|

Remarks

Refer to the Rows and Cards document for more information on 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-show-error-icons/CS/Form1.cs#L59

csharp
BaseEditViewInfo info = ((GridCellInfo)e.Cell).ViewInfo;
string error = GetError(e.CellValue, e.RowHandle, e.Column);
SetError(info, error);

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

csharp
if (lastMouseDownMoveCell == null || sourceGridCell == null) return;
if (e.RowHandle == lastMouseDownMoveCell.RowHandle && e.Column == lastMouseDownMoveCell.Column)
    e.Cache.DrawRectangle(e.Cache.GetPen(Color.Gray), new Rectangle(e.Bounds.X, e.Bounds.Y, e.Bounds.Width, e.Bounds.Height));

winforms-grid-highlight-cell-values-matching-text-in-autofilterrow/CS/CarsGridWinApp15/Main.cs#L27

csharp
GridView view = (GridView)sender;
if (!view.OptionsView.ShowAutoFilterRow || !view.IsDataRow(e.RowHandle))
    return;

winforms-grid-show-editor-buttons-on-cell-hover/CS/WindowsApplication3/Form1.cs#L39

csharp
private void gridView1_CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e) {
    if(e.Column.FieldName == "Text" && e.RowHandle == rowHandle) {
        GridCellInfo cellInfo = e.Cell as GridCellInfo;

winforms-grid-draw-thick-border-abound-focused-cell/CS/Form1.cs#L16

csharp
GridView view = sender as GridView;
if (e.Column == view.FocusedColumn && e.RowHandle == view.FocusedRowHandle) {
    e.DefaultDraw();

winforms-grid-show-error-icons/VB/Form1.vb#L67

vb
Dim info As BaseEditViewInfo = CType(e.Cell, GridCellInfo).ViewInfo
Dim [error] As String = GetError(e.CellValue, e.RowHandle, e.Column)
SetError(info, [error])

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

vb
End If
If e.RowHandle = lastMouseDownMoveCell.RowHandle AndAlso e.Column Is lastMouseDownMoveCell.Column Then
    e.Cache.DrawRectangle(e.Cache.GetPen(Color.Gray), New Rectangle(e.Bounds.X, e.Bounds.Y, e.Bounds.Width, e.Bounds.Height))

winforms-grid-highlight-cell-values-matching-text-in-autofilterrow/VB/CarsGridWinApp15/Main.vb#L23

vb
Dim view As GridView = CType(sender, GridView)
If Not view.OptionsView.ShowAutoFilterRow OrElse Not view.IsDataRow(e.RowHandle) Then Return
Dim filterCellText As String = view.GetRowCellDisplayText(GridControl.AutoFilterRowHandle, e.Column)

winforms-grid-show-editor-buttons-on-cell-hover/VB/WindowsApplication3/Form1.vb#L42

vb
Private Sub gridView1_CustomDrawCell(ByVal sender As Object, ByVal e As DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs) Handles gridView1.CustomDrawCell
    If e.Column.FieldName = "Text" AndAlso e.RowHandle = rowHandle Then
        Dim cellInfo As GridCellInfo = TryCast(e.Cell, GridCellInfo)

winforms-grid-draw-thick-border-abound-focused-cell/VB/Form1.vb#L21

vb
Dim view As GridView = TryCast(sender, GridView)
If e.Column Is view.FocusedColumn AndAlso e.RowHandle = view.FocusedRowHandle Then
    e.DefaultDraw()

See Also

Column

RowCellCustomDrawEventArgs Class

RowCellCustomDrawEventArgs Members

DevExpress.XtraGrid.Views.Base Namespace