ClassTreeBinding
Provides base functionality for configuring data binding in hierarchical Telerik components such as PanelBar, TreeView, and Menu. Define field mappings between your data model properties and component item properties to control how data is displayed. Use this to specify which fields contain item text, icons, URLs, parent-child relationships, and other hierarchical data structure elements.
Definition
Namespace:Telerik.Blazor.Components.Common.Trees
Assembly:Telerik.Blazor.dll
Syntax:
public abstract class TreeBinding : ComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
Inheritance: objectComponentBaseTreeBinding
Derived Classes:
Implements:
Inherited Members
Constructors
TreeBinding()
Declaration
protected TreeBinding()
Properties
HasChildrenField
Specifies the data field name that indicates whether an item has child items, optimizing performance by avoiding unnecessary child data loading. Set to a boolean field that returns true when an item has children and false when it's a leaf node. This is particularly useful for load-on-demand scenarios. Example: "HasChildren", "HasSubItems", or "IsParent". This parameter is required and cannot be null - an "ArgumentNullException" will be thrown if not specified.
Declaration
[Parameter]
public string HasChildrenField { get; set; }
Property Value
IconField
Specifies the data field name that contains icon identifiers or CSS classes for displaying icons next to PanelBar item text. Icons enhance visual hierarchy and help users quickly identify different types of content or categories. Can contain Telerik icon names, Font Awesome classes, or custom CSS icon classes. Example: "IconClass", "Icon", or "ImageUrl". This parameter is required and cannot be null - an "ArgumentNullException" will be thrown if not specified.
Declaration
[Parameter]
public string IconField { get; set; }
Property Value
IdField
Specifies the data field name that contains unique identifiers for each data item. This field is essential for tracking item state, establishing parent-child relationships, and managing component performance. The value should be unique across all items in your data set. Example: "Id", "Key", or "UniqueIdentifier". This parameter is required and cannot be null - an "ArgumentNullException" will be thrown if not specified.
ItemsField
Specifies the data field name that contains the collection of child items for hierarchical data structures. Use this when your data is organized as nested objects where each parent contains an array or list of child items. The field should contain an IEnumerable collection of the same data type. Example: "Items", "Children", or "SubCategories". This parameter is required and cannot be null - an "ArgumentNullException" will be thrown if not specified.
Declaration
[Parameter]
public string ItemsField { get; set; }
Property Value
Level
Specifies the hierarchical level in the data structure where this binding configuration should be applied. Set to null for the default binding that applies to all levels, or specify a number (0, 1, 2, etc.) to target a specific level. Level 0 represents root items, level 1 represents first-level children, and so on. Example: Level = 1 for second-level items.
ParentIdField
Specifies the data field name that contains the parent identifier for establishing hierarchical relationships in flat data structures. Use this when your data is stored as a flat list where each item references its parent through an ID field. The value should match the IdField of the parent item. Example: "ParentId", "ManagerId", or "CategoryId". This parameter is required and cannot be null - an "ArgumentNullException" will be thrown if not specified.
Declaration
[Parameter]
public string ParentIdField { get; set; }
Property Value
TextField
Specifies the data field name that contains the display text for PanelBar item headers. This text appears in the clickable header area of each panel item and represents the main content label users will see. Example: "Title", "Name", "Label", or "DisplayText". This parameter is required and cannot be null - an "ArgumentNullException" will be thrown if not specified.
Declaration
[Parameter]
public string TextField { get; set; }
Property Value
UrlField
Specifies the data field name that contains navigation URLs for PanelBar items that should function as links. When an item with a URL is clicked, the application will navigate to the specified address. Can contain relative URLs (e.g., "/products"), absolute URLs (e.g., "https://example.com"), or hash links (e.g., "#section1"). This parameter is required and cannot be null - an "ArgumentNullException" will be thrown if not specified.
Declaration
[Parameter]
public string UrlField { get; set; }
Property Value
Methods
Dispose()
Declaration
public void Dispose()
Implements
OnInitialized()
Declaration
protected override void OnInitialized()
Overrides