New to Telerik UI for Blazor? Download free 30-day trial

TreeList Templates

You can customize the TreeList appearance and behavior through the various templates it provides so you can add more details for your users - such as format numbers and dates, show images and so on.

The TreeList component can use templates for:

  • columns (cells) - the rendering of each cell (column). You can, for example, change string formats or add your own components.

  • editing of a cell - when a cell is in edit mode, it will render this template where you can use custom editors, components and logic.

  • rows - the entire rendering of the tr element of the row, so you can fully customize the treelist behavior and rendering.

  • column header - the title portion of the column.

  • filter - the content of the filter cell or filter menu where you can implement custom rendering and logic for the filters.

  • no data available - when the TreeList Data collection is empty or null, you can customize the content inside.

  • pager - the template modifies the layout, content, and functionality of the Pager.

Like other Blazor content, most of them can receive a context argument that is the type of the model. To use templates, you must bind the treelist to a named model. The filter and header templates are the exception as they are not related to rows and models.

You must make sure to provide valid HTML in the templates.

See Also

In this article