Back to Devexpress

RowEventArgs.Row Property

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

latest5.2 KB
Original Source

RowEventArgs.Row Property

Gets the processed row.

Namespace : DevExpress.Xpf.Grid

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

NuGet Package : DevExpress.Wpf.Grid.Core

Declaration

csharp
public object Row { get; }
vb
Public ReadOnly Property Row As Object

Property Value

TypeDescription
Object

An object that represents the processed row.

|

Remarks

To obtain the data object that corresponds to the processed row, type cast the Row property. The row’s handle is returned by the RowEventArgs.RowHandle property.

The following code snippets (auto-collected from DevExpress Examples) contain references to the Row 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-grid-prevent-expand-collapse-operations-for-group-rows/CS/Forbid_Expand_Collapse/MainWindow.xaml.cs#L26

csharp
void OnGroupRowCollapsing(object sender, RowAllowEventArgs e) {
    if (e.Row != null && grid.GetGroupRowValue(e.RowHandle).Equals(InvoiceStatus.Invalidated))
        e.Allow = false;

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

csharp
var fieldName = $"{UnboundColumnPrefix}{e.Column.FieldName}";
var key = Tuple.Create(e.Row, fieldName);
object originalValue;

wpf-data-grid-filter-column-lookupedit-based-on-value-in-another-column/CS/MainWindow.xaml.cs#L62

csharp
if (e.Column.FieldName == "CountryId") {
    SampleData sd = (SampleData)e.Row;
    sd.CityId = -1;

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

csharp
if(e.RowHandle != DataControlBase.NewItemRowHandle) {
    editingCache = CopyOperationsSupporter.Clone(e.Row);
}

wpf-grid-prevent-expand-collapse-operations-for-group-rows/VB/Forbid_Expand_Collapse/MainWindow.xaml.vb#L27

vb
Private Sub OnGroupRowCollapsing(ByVal sender As Object, ByVal e As RowAllowEventArgs)
    If e.Row IsNot Nothing AndAlso Me.grid.GetGroupRowValue(e.RowHandle).Equals(InvoiceStatus.Invalidated) Then e.Allow = False
End Sub

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

vb
Dim fieldName = $"{HighlightModifiedCells.ChangedCellsHighlightBehavior.UnboundColumnPrefix} {e.Column.FieldName}"
Dim key = System.Tuple.Create(e.Row, fieldName)
Dim originalValue As Object

wpf-data-grid-filter-column-lookupedit-based-on-value-in-another-column/VB/MainWindow.xaml.vb#L85

vb
If Equals(e.Column.FieldName, "CountryId") Then
    Dim sd As SampleData = CType(e.Row, SampleData)
    sd.CityId = -1

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

vb
If e.RowHandle <> DataControlBase.NewItemRowHandle Then
    editingCache = CopyOperationsSupporter.Clone(e.Row)
End If

See Also

ValidateRow

RowEventArgs Class

RowEventArgs Members

DevExpress.Xpf.Grid Namespace