Back to Devexpress

ASPxGridColumnDataEventArgs.ListSourceRowIndex Property

aspnet-devexpress-dot-web-dot-aspxgridcolumndataeventargs-36276289.md

latest2.6 KB
Original Source

ASPxGridColumnDataEventArgs.ListSourceRowIndex Property

Gets the current data item’s (row, card or record) index in the data source.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

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

Property Value

TypeDescription
Int32

An integer value that specifies the data item’s index in the data source.

|

The following code snippet (auto-collected from DevExpress Examples) contains a reference 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.

asp-net-web-forms-grid-editable-unbound-columns/CS/UnboundColumnForCommenting/Default.aspx.cs#L40

csharp
if(e.IsGetData && e.Column.FieldName == "Comment") {
    object key = e.GetListSourceFieldValue(e.ListSourceRowIndex, ASPxGridView1.KeyFieldName);
    e.Value = MyComments.GetComment(key);

asp-net-web-forms-grid-editable-unbound-columns/VB/UnboundColumnForCommenting/Default.aspx.vb#L37

vb
If e.IsGetData AndAlso Equals(e.Column.FieldName, "Comment") Then
    Dim key As Object = e.GetListSourceFieldValue(e.ListSourceRowIndex, ASPxGridView1.KeyFieldName)
    e.Value = GetComment(key)

See Also

ASPxGridColumnDataEventArgs Class

ASPxGridColumnDataEventArgs Members

DevExpress.Web Namespace