TreeListSelectionColumnCellDisplayTemplateContext.VisibleIndex Property
Returns the visible index of the current row.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v24.1.dll
NuGet Package: DevExpress.Blazor
Declaration
public int VisibleIndex { get; }
Property Value
Type | Description |
---|---|
Int32 | The row’s visible index. |
Remarks
Row Visible Indexes
Visible indexes indicate the order of visible data rows. Indexes are zero-based and sequential for rows on all TreeList pages.
The TreeList reassigns row indexes each time a user sorts or filters data and expands/collapses rows.
The following rows do not have visible indexes:
- Rows that are filtered out.
- Child rows of collapsed items
The following code snippet creates a TreeList column that displays visible indexes for rows:
@inject EmployeeTaskService EmployeeTaskService
<DxTreeList Data="TreeListData" KeyFieldName="Id" ParentKeyFieldName="ParentId">
<Columns>
<DxTreeListDataColumn Caption="Visible Index">
<CellDisplayTemplate>@context.VisibleIndex</CellDisplayTemplate>
</DxTreeListDataColumn>
<DxTreeListDataColumn FieldName="Name" Caption="Task" />
<DxTreeListDataColumn FieldName="EmployeeName" />
<DxTreeListDataColumn FieldName="StartDate" />
<DxTreeListDataColumn FieldName="DueDate" />
</Columns>
</DxTreeList>
@code {
List<EmployeeTask> TreeListData { get; set; }
protected override void OnInitialized() {
TreeListData = EmployeeTaskService.GenerateData();
}
}
Refer to the following property description for more information and an example: DxTreeListSelectionColumn.CellDisplayTemplate.
See Also