Back to Devexpress

GridColumnDataEventArgs.ListSourceRowIndex Property

wpf-devexpress-dot-xpf-dot-grid-dot-gridcolumndataeventargs-e2b287d4.md

latest4.6 KB
Original Source

GridColumnDataEventArgs.ListSourceRowIndex Property

Gets the index of the record in a data source to which the processed row corresponds.

Namespace : DevExpress.Xpf.Grid

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

NuGet Package : DevExpress.Wpf.Grid.Core

Declaration

csharp
public int ListSourceRowIndex { get; }
vb
Public ReadOnly Property ListSourceRowIndex As Integer

Property Value

TypeDescription
Int32

A zero-based integer value that specifies the index of the record in a data source to which the processed row corresponds.

|

The following code snippets (auto-collected from DevExpress Examples) contain references to the ListSourceRowIndex 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#L52

csharp
if (IsServiceColumn(e.Column)) {
    var key = Tuple.Create(AssociatedObject.GetRowByListIndex(e.ListSourceRowIndex), e.Column.FieldName);
    if (e.IsGetData) {

wpf-data-grid-create-custom-gridcontrol-that-displays-horizontal-columns/CS/dxExample/VGrid/VerticalGridControl.cs#L92

csharp
if (itemsSource == null) return;
var row = Rows[e.ListSourceRowIndex];
var item = itemsSource[Convert.ToInt32(e.Column.FieldName)];

wpf-data-grid-display-icon-in-unbound-column-based-on-value-in-bound-column/CS/UnboundColumnWithIcons_CodeBehind/Window1.xaml.cs#L24

csharp
if(e.IsGetData) {
    MyObject row = dataSource[e.ListSourceRowIndex];
    string resourceName = GetResourceName(row.Action);

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

vb
If HighlightModifiedCells.ChangedCellsHighlightBehavior.IsServiceColumn(e.Column) Then
    Dim key = System.Tuple.Create(Me.AssociatedObject.GetRowByListIndex(e.ListSourceRowIndex), e.Column.FieldName)
    If e.IsGetData Then

wpf-data-grid-create-custom-gridcontrol-that-displays-horizontal-columns/VB/dxExample/VGrid/VerticalGridControl.vb#L113

vb
End If
Dim row = Rows(e.ListSourceRowIndex)
Dim item = itemsSource_Renamed(Convert.ToInt32(e.Column.FieldName))

wpf-data-grid-display-icon-in-unbound-column-based-on-value-in-bound-column/VB/UnboundColumnWithIcons_CodeBehind/Window1.xaml.vb#L27

vb
If e.IsGetData Then
    Dim row As MyObject = dataSource(e.ListSourceRowIndex)
    Dim resourceName As String = GetResourceName(row.Action)

See Also

GridColumnDataEventArgs Class

GridColumnDataEventArgs Members

DevExpress.Xpf.Grid Namespace