wpf-devexpress-dot-xpf-dot-grid-dot-customcolumndisplaytexteventargs-0b90fcff.md
Gets the index of a record in a data source that corresponds to the processed data row.
Namespace : DevExpress.Xpf.Grid
Assembly : DevExpress.Xpf.Grid.v25.2.dll
NuGet Package : DevExpress.Wpf.Grid.Core
public int ListSourceIndex { get; }
Public ReadOnly Property ListSourceIndex As Integer
| Type | Description |
|---|---|
| Int32 |
An integer value that specifies the index of the processed record in a data source.
|
To learn more on row identifiers, see Identifying Rows and Cards and Obtaining Row Handles.
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ListSourceIndex 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-display-custom-text-in-cells/CS/DisplayCustomText_CodeBehind/MainWindow.xaml.cs#L21
void gridControl1_CustomColumnDisplayText(object sender, CustomColumnDisplayTextEventArgs e) {
if(!e.Column.Equals(columnProductName) || e.ListSourceIndex < 0)
return;
wpf-grid-display-custom-text-in-cells/VB/DisplayCustomText_CodeBehind/MainWindow.xaml.vb#L32
Private Sub gridControl1_CustomColumnDisplayText(ByVal sender As Object, ByVal e As CustomColumnDisplayTextEventArgs)
If Not e.Column.Equals(Me.columnProductName) OrElse e.ListSourceIndex < 0 Then Return
If CDbl(Me.gridControl1.GetCellValue(e.RowHandle, "Discount")) > 20 Then e.DisplayText =(CStr(e.Value)) & " (SALE)"
See Also
GetRowHandleByListIndex(Int32)
CustomColumnDisplayTextEventArgs Class