Back to Devexpress

RowObjectEventArgs.Row Property

windowsforms-devexpress-dot-xtragrid-dot-views-dot-base-dot-rowobjecteventargs.md

latest5.3 KB
Original Source

RowObjectEventArgs.Row Property

Gets the processed row.

Namespace : DevExpress.XtraGrid.Views.Base

Assembly : DevExpress.XtraGrid.v25.2.dll

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

Declaration

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

Property Value

TypeDescription
Object

An object which represents the processed row.

|

Remarks

The Row property’s value depends upon the View’s data source type. If the data source is a DataTable or a DataView, this property returns a DataRowView object. If the data source is a custom list of items, the appropriate list item is returned.

For group rows, the Row property returns null ( Nothing in Visual Basic).

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.

winforms-mvvm-expenses-app/CS/MVVMExpenses/Views/Account/AccountsView.cs#L33

csharp
.SetBinding(x => x.SelectedEntity,
    args => args.Row as DataModels.Account,
    (gView, entity) => gView.FocusedRowHandle = gView.FindRow(entity));

winforms-grid-crud-operations-odata/CS/DxSample/MainForm.cs#L25

csharp
if (e.RowHandle == GridControl.NewItemRowHandle)
    this.Context.AddToOrders((Order)e.Row);
else this.Context.UpdateObject(e.Row);

winforms-grid-edit-row-server-mode/CS/BindingListForServerMode/MainForm.cs#L12

csharp
private void GridView_FocusedRowObjectChanged(object sender, FocusedRowObjectChangedEventArgs e) {
    BindingSource.DataSource = Session.GetLoadedObjectByKey<ServerSideGridTest>(e.Row);
}

winforms-mvvm-expenses-app/VB/MVVMExpenses/Views/Account/AccountsView.vb#L34

vb
fluentAPI.WithEvent(Of DevExpress.XtraGrid.Views.Base.ColumnView, DevExpress.XtraGrid.Views.Base.FocusedRowObjectChangedEventArgs)(gridView1, "FocusedRowObjectChanged").SetBinding(Function(x) x.SelectedEntity, Function(args) TryCast(args.Row, DataModels.Account), Sub(gView, entity) gView.FocusedRowHandle = gView.FindRow(entity))
fluentAPI.WithEvent(Of DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs)(gridView1, "RowCellClick").EventToCommand(Sub(x) x.Edit(Nothing), Function(x) x.SelectedEntity, Function(args) (args.Clicks = 2) AndAlso (args.Button = MouseButtons.Left))

winforms-grid-crud-operations-odata/VB/DxSample/MainForm.vb#L27

vb
If e.RowHandle = GridControl.NewItemRowHandle Then
    Me.Context.AddToOrders(DirectCast(e.Row, Order))
Else

winforms-grid-edit-row-server-mode/VB/BindingListForServerMode/MainForm.vb#L14

vb
Private Sub GridView_FocusedRowObjectChanged(ByVal sender As Object, ByVal e As FocusedRowObjectChangedEventArgs) Handles GridView.FocusedRowObjectChanged
    BindingSource.DataSource = Session.GetLoadedObjectByKey(Of ServerSideGridTest)(e.Row)
End Sub

See Also

GetRow(Int32)

RowObjectEventArgs Class

RowObjectEventArgs Members

DevExpress.XtraGrid.Views.Base Namespace