A hierarchical data grid for displaying, editing, and interacting with tree-structured data. Bind fields for hierarchy with IdField, ParentIdField, ItemsField, and HasChildrenField; define columns in TreeListColumns. Supports expand/collapse events (OnExpand/OnCollapse), row events (OnRowRender/OnRowClick/OnRowDoubleClick/OnRowContextMenu), state persistence via OnStateInit/OnStateChanged with get/set APIs (GetState()/SetStateAsync(TreeListState<TItem>)). Provides selection modes (SelectionMode), cell selection and range with SelectedCells/SelectedCellsChanged; editing modes (EditMode Inline/Popup/Incell), filtering (FilterMode), scrolling (ScrollMode Scrollable/Virtual), toolbar templates (TreeListToolBar or TreeListToolBarTemplate), and pager customization (TreeListPagerTemplate). Drag-and-drop rows via OnRowDrop; programmatic utilities include auto-fit methods (AutoFitColumn(string), AutoFitColumns(IEnumerable<string>), AutoFitAllColumns()). Children: TreeListColumns, TreeListToolBarTemplate, TreeListToolBar.
Definition
Namespace:Telerik.Blazor.Components
Assembly:Telerik.Blazor.dll
Type Parameters:
TItem
The type of the model to which the TreeList is bound.
Syntax:
public class TelerikTreeList<TItem> : TableGridBase<TItem, TreeListCommandEventArgs>, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
Inheritance: objectComponentBaseBaseComponentDataBoundComponent<TItem>GridBase<TItem>TableGridBase<TItem, TreeListCommandEventArgs>TelerikTreeList<TItem>...
Implements:
Inherited Members
Methods
public void AutoFitAllColumns()
public Task AutoFitColumnsAsync(IEnumerable<string> ids)
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Overrides:
public override void Dispose()
Overrides:
protected override TItem GetItemFromDropIndex(int index)
TItem
Overrides:
GetState()
TreeListState<TItem>
Gets the current state of the TreeList. Includes sorting, filtering, edit items, column state, etc.
public TreeListState<TItem> GetState()
TreeListState<TItem>
Instance of a TreeListState<TItem> class that contains all data.
public override Task SetParametersAsync(ParameterView parameters)
Overrides:
Sets the state of the TreeList. Includes sorting, filtering, edit items, column state, etc.
public Task SetStateAsync(TreeListState<TItem> state)
Properties
protected string EditFieldOnStateInit { get; set; }
Enables WebMCP tool registration for this TreeList. When true, TreeList operations are exposed as tools discoverable by AI models through the browser.
Configure tool names and overrides via TreeListWebMcpSettings inside TreeListSettings.
[Parameter]
public bool EnableWebMcpTools { get; set; }
Defines the Filter Mode of the Component.
[Parameter]
public TreeListFilterMode FilterMode { get; set; }
Defines the HasChildren DataField of the DataSource.
[Parameter]
public string HasChildrenField { get; set; }
Defines the Id DataField of the DataSource.
[Parameter]
public string IdField { get; set; }
Defines the Items DataField of the DataSource that contains the child nodes.
[Parameter]
public string ItemsField { get; set; }
The position at which a new data item is inserted in the TreeList - top or bottom. Default value is Top.
[Parameter]
public TreeListNewRowPosition NewRowPosition { get; set; }
Fires when a row is collapsed.
[Parameter]
public EventCallback<TreeListCollapseEventArgs> OnCollapse { get; set; }
Fires when a row is expanded.
[Parameter]
public EventCallback<TreeListExpandEventArgs> OnExpand { get; set; }
Fires when the user clicks on a row, or presses enter.
[Parameter]
public EventCallback<TreeListRowClickEventArgs> OnRowClick { get; set; }
Fires when the user triggers contextmenu event with click or context menu button.
[Parameter]
public EventCallback<TreeListRowClickEventArgs> OnRowContextMenu { get; set; }
Fires when the user double-clicks on a row.
[Parameter]
public EventCallback<TreeListRowClickEventArgs> OnRowDoubleClick { get; set; }
Fired when a row is dropped.
[Parameter]
public EventCallback<TreeListRowDropEventArgs<TItem>> OnRowDrop { get; set; }
Called each time a row is rendered. Use this to add custom classes to the row based on the data item.
[Parameter]
public Action<TreeListRowRenderEventArgs> OnRowRender { get; set; }
Fires on user interaction that causes changes in the TreeListState<TItem>.
[Parameter]
public EventCallback<TreeListStateEventArgs<TItem>> OnStateChanged { get; set; }
Invoked when the TreeList is initialized and state could be loaded. Useful when you'd like to persist changed on page reloads.
[Parameter]
public EventCallback<TreeListStateEventArgs<TItem>> OnStateInit { get; set; }
Defines the ParentId DataField of the DataSource. Use this DataField when the component is bound to a flat data structure.
[Parameter]
public string ParentIdField { get; set; }
Defines scrolling mode of the TreeList. Possible values are Scrollable and Virtual.
[Parameter]
public TreeListScrollMode ScrollMode { get; set; }
Defines the collection of selected cells. The parameter supports two-way binding. Also set SelectionMode.
[Parameter]
public IEnumerable<TreeListSelectedCellDescriptor> SelectedCells { get; set; }
The event fires when users select or unselect cell.
[Parameter]
public EventCallback<IEnumerable<TreeListSelectedCellDescriptor>> SelectedCellsChanged { get; set; }
Defines the Selection Mode of the TreeList.
[Parameter]
public TreeListSelectionMode SelectionMode { get; set; }
Defines the container for the TreeList columns. Children: TreeListColumn, TreeListCheckboxColumn, TreeListCommandColumn.
[Parameter]
public RenderFragment TreeListColumns { get; set; }
Defines the template that will be displayed instead of the Pager.
[Parameter]
public RenderFragment TreeListPagerTemplate { get; set; }
[Parameter]
public RenderFragment TreeListSettings { get; set; }
Defines the tools for the toolbar of the TreeList. Children: TreeListCommandButton, TreeListSearchBox, TreeListToolBarAddTool, TreeListToolBarSpacerTool, TreeListToolBarCustomTool .
[Parameter]
public RenderFragment TreeListToolBar { get; set; }
Defines the toolbar of the TreeList.
[Parameter]
public RenderFragment TreeListToolBarTemplate { get; set; }