Skip to main content
A newer version of this page is available. .

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.v19.1.dll

Declaration

public int ListSourceRowIndex { get; }

Property Value

Type Description
Int32

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

Example

This example demonstrates how to emulate row selection via an unbound column with a checkbox. The grid’s built-in editing is used. It’s enabled when the view’s NavigationStyle property is set to CellNavigation. Starting from the 12.1.8 version, we support a new way of implementing multiple row selection via a checked column. Please refer to the following article, which shows how to implement this: How to implement multiple row selection behavior via a checked column.

<Window x:Class="UnboundCheckColumn.Window1" 
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"  
        xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
        xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
        Title="Window1" Height="600" Width="400">
    <StackPanel>
        <Button Click="BtnInvert_Click">Invert selection</Button>
        <Button Click="BtnGetSelected_Click">Get selection</Button>
        <dxg:GridControl x:Name="grid" CustomUnboundColumnData="grid_CustomUnboundColumnData" Height="500" ItemsSource="{Binding List}">
            <dxg:GridControl.Columns>
                <dxg:GridColumn FieldName="Id" />
                <dxg:GridColumn FieldName="Number" />
                <dxg:GridColumn FieldName="Selected" UnboundType="Boolean" AllowSorting="False">
                    <dxg:GridColumn.CellTemplate>
                        <DataTemplate>
                            <dxe:CheckEdit IsChecked="{Binding Data.Selected}" HorizontalAlignment="Center" VerticalAlignment="Center" />
                        </DataTemplate>
                    </dxg:GridColumn.CellTemplate>
                </dxg:GridColumn>
            </dxg:GridControl.Columns>
            <dxg:GridControl.View>
                <dxg:TableView x:Name="view" AutoWidth="True" />
            </dxg:GridControl.View>
        </dxg:GridControl>
    </StackPanel>
</Window>

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.

See Also