Back to Devexpress

CustomRowCellEventArgs.RowHandle Property

windowsforms-devexpress-dot-xtragrid-dot-views-dot-base-dot-customrowcelleventargs-b50bab17.md

latest6.2 KB
Original Source

CustomRowCellEventArgs.RowHandle Property

Gets the handle of the row that contains the processed cell.

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 specifying the handle of the row that contains the cell.

|

Remarks

See the Rows document for 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.

XAF-how-to-add-an-unbound-column-to-gridlisteditor-to-execute-a-custom-action-for-a-record/CS/EFCore/ButtonInListEF/ButtonInListEF.Win/Controllers/SimpleBusinessActionGridListViewController.cs#L92

csharp
if(e.Column.FieldName == ButtonColumnName) {
    ISimpleBusinessAction order = gridListEditor.GridView.GetRow(e.RowHandle) as ISimpleBusinessAction;
    if(order != null) {

winforms-grid-update-row-style-on-cell-value-change/CS/Form1.cs#L54

csharp
{
    if (!true.Equals(gridView1.GetRowCellValue(e.RowHandle, "UseStyles")))
        return;

winforms-grid-highlight-modified-cells/CS/Form1.cs#L32

csharp
void gridView1_RowCellStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowCellStyleEventArgs e) {
    if (CellExists(gridView1.GetDataSourceRowIndex(e.RowHandle), e.Column)) {
        e.Appearance.BackColor = Color.ForestGreen;

winforms-grid-customize-cell-color/CS/CellColorHelper.cs#L29

csharp
{
    Color color = GetCellColor(new MyGridCell(e.RowHandle, e.Column));
    if (color.IsEmpty)

winforms-grid-hide-check-box-from-certain-cells/CS/CS/Form1.cs#L122

csharp
if(e.Column.FieldName == "Discontinued" &&
    NeedToHideDiscontinuedCheckbox(sender as GridView, e.RowHandle))
    e.RepositoryItem = emptyEditor;

winforms-grid-update-row-style-on-cell-value-change/VB/Form1.vb#L52

vb
Private Sub gridView1_RowCellStyle(ByVal sender As Object, ByVal e As RowCellStyleEventArgs)
    If Not True.Equals(gridView1.GetRowCellValue(e.RowHandle, "UseStyles")) Then Return
    e.Appearance.BackColor = GetRowBackColor(e.RowHandle)

winforms-grid-highlight-modified-cells/VB/Form1.vb#L34

vb
Private Sub gridView1_RowCellStyle(ByVal sender As Object, ByVal e As DevExpress.XtraGrid.Views.Grid.RowCellStyleEventArgs)
    If CellExists(gridView1.GetDataSourceRowIndex(e.RowHandle), e.Column) Then
        e.Appearance.BackColor = Color.ForestGreen

winforms-grid-customize-cell-color/VB/CellColorHelper.vb#L25

vb
Private Sub _View_RowCellStyle(ByVal sender As Object, ByVal e As RowCellStyleEventArgs)
    Dim color As Color = GetCellColor(New MyGridCell(e.RowHandle, e.Column))
    If color.IsEmpty Then Return

winforms-grid-hide-check-box-from-certain-cells/VB/CS/Form1.vb#L112

vb
Private Sub gridView1_CustomRowCellEdit(ByVal sender As Object, ByVal e As CustomRowCellEditEventArgs)
    If Equals(e.Column.FieldName, "Discontinued") AndAlso NeedToHideDiscontinuedCheckbox(TryCast(sender, GridView), e.RowHandle) Then e.RepositoryItem = emptyEditor
End Sub

See Also

Column

GetRowCellValue

GetVisibleIndex(Int32)

CustomRowCellEventArgs Class

CustomRowCellEventArgs Members

DevExpress.XtraGrid.Views.Base Namespace