Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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

C#
public interface ITreeListColumn

#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.";
    }
}

TreeList - Row Click

See Also