Back to Devexpress

DataControlBase.GetRow(Int32) Method

wpf-devexpress-dot-xpf-dot-grid-dot-datacontrolbase-dot-getrow-x28-system-dot-int32-x29.md

latest4.3 KB
Original Source

DataControlBase.GetRow(Int32) Method

Returns a row object that corresponds to the specified row handle.

Namespace : DevExpress.Xpf.Grid

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

NuGet Package : DevExpress.Wpf.Grid.Core

Declaration

csharp
public object GetRow(
    int rowHandle
)
vb
Public Function GetRow(
    rowHandle As Integer
) As Object

Parameters

NameTypeDescription
rowHandleInt32

An integer value that specifies the row’s handle.

|

Returns

TypeDescription
Object

An object that corresponds to the specified row handle.

|

Remarks

To obtain a row object that corresponds to a row with the specified handle, use the GetRow method. Row objects represent records in a data source. For instance, a DataRow object represents a record in a DataTable.

To learn more, see Obtaining Row Handles and Identifying Rows and Cards.

The following code snippets (auto-collected from DevExpress Examples) contain references to the GetRow(Int32) method.

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-highlight-specific-cells/CS/MainWindow.xaml.cs#L13

csharp
ObservableCollection<HighlightedGridCell> cellsToHiglight = new ObservableCollection<HighlightedGridCell>();
cellsToHiglight.Add(new HighlightedGridCell(gridControl1.GetRow(0), gridControl1.Columns["ID"], Colors.Red));
CellsHighlightHelper.SetCellsToHighlight(gridControl1, cellsToHiglight);

wpf-data-grid-obtain-rows-visible-on-screen/CS/IScrollInfoSample/Window1.xaml.cs#L31

csharp
continue;
var item = grid.GetRow(handle) as Item;
if (item == null)

wpf-grid-highlight-specific-cells/VB/MainWindow.xaml.vb#L14

vb
Dim cellsToHiglight As New ObservableCollection(Of HighlightedGridCell)()
cellsToHiglight.Add(New HighlightedGridCell(gridControl1.GetRow(0), gridControl1.Columns("ID"), Colors.Red))
CellsHighlightHelper.SetCellsToHighlight(gridControl1, cellsToHiglight)

wpf-data-grid-obtain-rows-visible-on-screen/VB/IScrollInfoSample/Window1.xaml.vb#L31

vb
If Not Me.grid.IsValidRowHandle(handle) Then Continue For
Dim item = TryCast(Me.grid.GetRow(handle), Item)
If item Is Nothing Then

See Also

GetRowByListIndex(Int32)

GetFocusedRow()

DataControlBase Class

DataControlBase Members

DevExpress.Xpf.Grid Namespace