Back to Devexpress

RowEventArgs.RowHandle Property

wpf-devexpress-dot-xpf-dot-grid-dot-roweventargs.md

latest6.1 KB
Original Source

RowEventArgs.RowHandle Property

Gets the processed row’s handle.

Namespace : DevExpress.Xpf.Grid

Assembly : DevExpress.Xpf.Grid.v25.2.dll

NuGet Package : DevExpress.Wpf.Grid.Core

Declaration

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

Property Value

TypeDescription
Int32

An integer value that specifies the processed row’s handle.

|

Remarks

For detailed information on how to identify rows by their handles and visible indices, see Identifying Rows and Cards.

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.

wpf-data-grid-change-background-color-for-modified-cells/CS/HighlightChangedCellBehavior.cs#L47

csharp
originalValues[key] = e.OldValue;
    AssociatedObject.SetCellValue(e.RowHandle, fieldName, isModified);
}

wpf-grid-select-child-rows-in-groups-on-click/CS/GridGroupSelect/GroupChildSelector.cs#L26

csharp
grid.BeginSelection();
SelectChild(grid, e.RowHandle);
grid.EndSelection();

wpf-data-grid-initialize-new-item-row-with-default-values/CS/NewItemRow_CodeBehind/MainWindow.xaml.cs#L48

csharp
void OnInvalidRowException(object sender, InvalidRowExceptionEventArgs e) {
    if(e.RowHandle == GridControl.NewItemRowHandle) {
        e.ErrorText = "Please enter the Product Name.";

wpf-data-grid-specify-edit-form-settings/CS/DefineEditFormSettings_CodeBehind/MainWindow.xaml.cs#L49

csharp
private void OnRowEditStarting(object sender, RowEditStartingEventArgs e) {
    if(Equals(e.RowHandle, DataControlBase.NewItemRowHandle)) {
        e.CellEditors[0].Value = grid.VisibleRowCount + 1;

wpf-data-grid-extend-crud-operations/CS/Undo/UndoCRUDOperationsBehavior.cs#L92

csharp
void OnEditingStarted(object sender, RowEditStartedEventArgs e) {
    if(e.RowHandle != DataControlBase.NewItemRowHandle) {
        editingCache = CopyOperationsSupporter.Clone(e.Row);

wpf-data-grid-change-background-color-for-modified-cells/VB/HighlightChangedCellBehavior.vb#L68

vb
Me.AssociatedObject.SetCellValue(e.RowHandle, fieldName, isModified)
End If

wpf-grid-select-child-rows-in-groups-on-click/VB/GridGroupSelect/GroupChildSelector.vb#L30

vb
grid.BeginSelection()
SelectChild(grid, e.RowHandle)
grid.EndSelection()

wpf-data-grid-initialize-new-item-row-with-default-values/VB/NewItemRow_CodeBehind/MainWindow.xaml.vb#L53

vb
Private Sub OnInvalidRowException(ByVal sender As Object, ByVal e As InvalidRowExceptionEventArgs)
    If e.RowHandle = DataControlBase.NewItemRowHandle Then
        e.ErrorText = "Please enter the Product Name."

wpf-data-grid-specify-edit-form-settings/VB/DefineEditFormSettings_CodeBehind/MainWindow.xaml.vb#L92

vb
Private Sub OnRowEditStarting(ByVal sender As Object, ByVal e As RowEditStartingEventArgs)
    If Equals(e.RowHandle, DataControlBase.NewItemRowHandle) Then
        e.CellEditors(0).Value = Me.grid.VisibleRowCount + 1

wpf-data-grid-extend-crud-operations/VB/Undo/UndoCRUDOperationsBehavior.vb#L121

vb
Private Sub OnEditingStarted(ByVal sender As Object, ByVal e As RowEditStartedEventArgs)
    If e.RowHandle <> DataControlBase.NewItemRowHandle Then
        editingCache = CopyOperationsSupporter.Clone(e.Row)

See Also

RowEventArgs Class

RowEventArgs Members

DevExpress.Xpf.Grid Namespace