New to Telerik UI for ASP.NET Core? Start a free 30-day trial

Kendo UI TreeView component

Definition

Namespace:Kendo.Mvc.UI

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class TreeView : WidgetBase, IHtmlAttributesContainer, INavigationItemComponent<TreeViewItem>, INavigationItemContainer<TreeViewItem>

Inheritance: objectWidgetBaseTreeView

Implements: IHtmlAttributesContainerINavigationItemComponent<TreeViewItem>INavigationItemContainer<TreeViewItem>

Inherited Members WidgetBase.Render()WidgetBase.ToClientTemplate()WidgetBase.ToHtmlString()WidgetBase.VerifySettings()WidgetBase.WriteDeferredStyles(TextWriter)WidgetBase.DeferStyles()WidgetBase.ProcessSettings()WidgetBase.GetHtml(bool)WidgetBase.GetInitializator()WidgetBase.RenderHtml(TextWriter)WidgetBase.GetElement()WidgetBase.WriteLicensingScript(TextWriter)WidgetBase.WriteMvvmHtml(TextWriter)WidgetBase.WriteDeferredScriptInitialization()WidgetBase.GetService<TService>()WidgetBase.EventsWidgetBase.IdWidgetBase.SanitezeIdWidgetBase.WriterWidgetBase.InitializerWidgetBase.IsInClientTemplateWidgetBase.IsSelfInitializedWidgetBase.HasDeferredInitializationWidgetBase.HtmlAttributesWidgetBase.ScriptAttributesWidgetBase.HtmlHelperWidgetBase.ModelMetadataProviderWidgetBase.NameWidgetBase.ExplorerWidgetBase.SelectorWidgetBase.IdPrefixWidgetBase.ViewContextWidgetBase.ValueProviderWidgetBase.GeneratorWidgetBase.UrlGeneratorWidgetBase.HtmlEncoderWidgetBase.HasClientComponentWidgetBase.UseMvvmInitializationobject.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Constructors

Initializes a new instance of the TreeView class.

C#
public TreeView(ViewContext viewContext)
Parameters:viewContextViewContext

Properties

Animation member.

C#
public ExpandableAnimation Animation { get; }

Gets or sets the Authorization.

C#
public INavigationItemAuthorization Authorization { get; }

Implements: INavigationItemComponent<TreeViewItem>.Authorization

If set to false the widget will not bind to the data source during initialization. In this case data binding will occur when the change event of the data source is fired. By default the widget will bind to the data source specified in the configuration.

C#
public bool? AutoBind { get; set; }

If set to true the widget will auto-scroll the containing element when the mouse/finger is close to the top/bottom of it.

C#
public bool? AutoScroll { get; set; }

If true or an object, renders checkboxes beside each node.

C#
public TreeViewCheckboxesSettings Checkboxes { get; }

Sets the field of the data item that provides the icon name of the nodes. If an array, each level uses the field that is at the same index in the array, or the last item in the array.

C#
public string[] DataIconField { get; set; }

Sets the field of the data item that provides the image URL of the TreeView nodes.

C#
public string DataImageUrlField { get; set; }

Gets or sets the DataSource.

C#
public DataSource DataSource { get; }

Gets or sets the DataSourceId.

C#
public string DataSourceId { get; set; }

Sets the field of the data item that provides the sprite CSS class of the nodes. If an array, each level uses the field that is at the same index in the array, or the last item in the array.

C#
public string DataSpriteCssClassField { get; set; }

Sets the field of the data item that provides the text content of the nodes. If an array, each level uses the field that is at the same index in the array, or the last item in the array.

C#
public string[] DataTextField { get; set; }

Sets the field of the data item that provides the link URL of the nodes.

C#
public string DataUrlField { get; set; }

Disables (false) or enables (true) drag-and-drop of the nodes. If configured as an object allows disabling click move click interaction as an alternative of dragging.

C#
public TreeViewDragAndDropSettings DragAndDrop { get; }

Gets or sets a value indicating whether all the item is expanded.

C#
public bool ExpandAll { get; set; }
Property Value:

true if expand all is enabled; otherwise, false. The default value is false

Gets or sets the HighlightPath.

C#
public bool HighlightPath { get; set; }

Gets or sets the item action.

C#
public Action<TreeViewItem> ItemAction { get; set; }

Implements: INavigationItemComponent<TreeViewItem>.ItemAction

Gets the items of the treeview.

C#
public IList<TreeViewItem> Items { get; }

Implements: INavigationItemContainer<TreeViewItem>.Items

Indicates whether the child DataSources should be fetched lazily when parent groups get expanded. Setting this to false causes all child DataSources to be loaded at initialization time.

C#
public bool? LoadOnDemand { get; set; }

The text messages displayed in the widget. Use it to customize or localize the messages.

C#
public TreeViewMessagesSettings Messages { get; }

Gets or sets the SecurityTrimming.

C#
public SecurityTrimming SecurityTrimming { get; set; }

Implements: INavigationItemComponent<TreeViewItem>.SecurityTrimming

Gets or sets the SelectedIndex.

C#
public int SelectedIndex { get; set; }

Sets the size of the component.

C#
public ComponentSize? Size { get; set; }

Template for rendering each node.

C#
public string Template { get; set; }

The handler that returns the template used for Template

C#
public string TemplateHandler { get; set; }

The id of the script element used for Template

C#
public string TemplateId { get; set; }

Methods

Serializes the component settings to a dictionary.

C#
public override IDictionary<string, object> Serialize()
Returns:

IDictionary<string, object>

A dictionary of settings.

Overrides: WidgetBase.Serialize()

SerializeSettings method.

C#
protected override Dictionary<string, object> SerializeSettings()
Returns:

Dictionary<string, object>

Overrides: WidgetBase.SerializeSettings()

Writes the HTML content.

C#
protected override void WriteHtml(TextWriter writer)
Parameters:writerTextWriter

The text writer.

Overrides: WidgetBase.WriteHtml(TextWriter)

WriteInitializationScript method.

C#
public override void WriteInitializationScript(TextWriter writer)
Parameters:writerTextWriter

Overrides: WidgetBase.WriteInitializationScript(TextWriter)