ITreeListColumn Interface
An interface that defines a TreeList column’s API members (properties and methods).
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v24.2.dll
NuGet Package: DevExpress.Blazor
Declaration
public interface ITreeListColumn
Related API Members
The following members return ITreeListColumn objects:
Remarks
Use the ITreeListColumn
interface when you access a TreeList column’s API members as follows:
- You use the
@ref
attribute to reference a TreeList column. - You access a
Column
object from templates or event handlers. - You access elements of the TreeList column collection (for instance, the collection that the GetColumns() method returns).
In other cases, bind your data to column parameters.
Note
To change values of a TreeList column’s parameters outside the component’s markup, enclose your code between BeginUpdate() and EndUpdate() method calls. Otherwise, an exception occurs.
The following example displays the column caption that corresponds to the clicked cell. The Column event argument returns an ITreeListColumn
object. This object is the column that contains the clicked cell.
@inject EmployeeTaskService EmployeeTaskService
<DxTreeList Data="TreeListData" KeyFieldName="Id" ParentKeyFieldName="ParentId" RowClick="OnRowClick">
<Columns>
<DxTreeListDataColumn FieldName="Name" Caption="Task" />
<DxTreeListDataColumn FieldName="EmployeeName" Caption="Employee Name" />
<DxTreeListDataColumn FieldName="StartDate" Caption="Start Date" />
<DxTreeListDataColumn FieldName="DueDate" Caption="Due Date" />
</Columns>
</DxTreeList>
@Alert
@code {
List<EmployeeTask> TreeListData { get; set; }
public string Alert { get; set; } = "";
protected override void OnInitialized() {
TreeListData = EmployeeTaskService.GenerateData();
}
void OnRowClick(TreeListRowClickEventArgs e) {
Alert = $"You clicked a cell in the {e.Column.Caption} column.";
}
}