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

Defines the fluent API for configuring the Telerik UI for ASP.NET Core TreeMap

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class TreeMapBuilder : WidgetBuilderBase<TreeMap, TreeMapBuilder>, IHtmlContent

Inheritance: objectHelperResultWidgetBuilderBase<TreeMap, TreeMapBuilder>TreeMapBuilder

Implements: IHtmlContent

Inherited Members WidgetBuilderBase<TreeMap, TreeMapBuilder>.ToComponent()WidgetBuilderBase<TreeMap, TreeMapBuilder>.Expression(string)WidgetBuilderBase<TreeMap, TreeMapBuilder>.Explorer(ModelExplorer)WidgetBuilderBase<TreeMap, TreeMapBuilder>.Name(string)WidgetBuilderBase<TreeMap, TreeMapBuilder>.Deferred(bool)WidgetBuilderBase<TreeMap, TreeMapBuilder>.HtmlAttributes(object)WidgetBuilderBase<TreeMap, TreeMapBuilder>.HtmlAttributes(IDictionary<string, object>)WidgetBuilderBase<TreeMap, TreeMapBuilder>.ScriptAttributes(object, bool)WidgetBuilderBase<TreeMap, TreeMapBuilder>.ScriptAttributes(IDictionary<string, object>, bool)WidgetBuilderBase<TreeMap, TreeMapBuilder>.Render()WidgetBuilderBase<TreeMap, TreeMapBuilder>.ToHtmlString()WidgetBuilderBase<TreeMap, TreeMapBuilder>.WriteTo(TextWriter, HtmlEncoder)WidgetBuilderBase<TreeMap, TreeMapBuilder>.ToClientTemplate()WidgetBuilderBase<TreeMap, TreeMapBuilder>.AsModule(bool)WidgetBuilderBase<TreeMap, TreeMapBuilder>.ComponentWidgetBuilderBase<TreeMap, TreeMapBuilder>.ContainerHelperResult.WriteTo(TextWriter, HtmlEncoder)HelperResult.WriteActionobject.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 TreeMapBuilder class.

C#
public TreeMapBuilder(TreeMap component)
Parameters:componentTreeMap

Methods

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 TreeMapBuilder AutoBind(bool value)
Parameters:valuebool

The value for AutoBind

Returns:

TreeMapBuilder

Returns the current TreeMapBuilder instance.

Example:
C#
@(Html.Kendo().TreeMap()
.Name("treeMap")
.AutoBind(false)
.DataSource(...)
)

The data item field which contains the tile color.

C#
public TreeMapBuilder ColorField(string value)
Parameters:valuestring

The value for ColorField

Returns:

TreeMapBuilder

Returns the current TreeMapBuilder instance.

Example:
C#
@(Html.Kendo().TreeMap()
.Name("treeMap")
.ColorField("color")
.DataSource(dataSource =&gt; dataSource
.Read(read =&gt; read.Action("ActionName", "ControllerName"))
.Model(m =&gt; m.Children("Items"))
)
)

Defines the default colors for the TreeMap items (tiles).

C#
public TreeMapBuilder Colors(Action<TreeMapColorRangeFactory> configurator)
Parameters:configuratorAction<TreeMapColorRangeFactory>

The action that configures the colors.

Returns:

TreeMapBuilder

Returns the current TreeMapBuilder instance.

Example:
C#
@(Html.Kendo().TreeMap()
.Name("treeMap")
.Colors(color =&gt;
{
color.AddRange("#0072c6", "#cbe2f3");
color.AddRange("#5db2ff", "#deeffe");
})
)

The default colors for the TreeMap items (tiles). Can be set to array of specific colors or array of color ranges. For more information on the widget behavior, see the Colors section on the TreeMap Overview page.

C#
public TreeMapBuilder Colors(params string[] value)
Parameters:valuestring[]

The value for Colors

Returns:

TreeMapBuilder

Returns the current TreeMapBuilder instance.

Example:
C#
@(Html.Kendo().TreeMap()
.Name("treeMap")
.Colors(color =&gt;
{
color.AddRange("#0072c6", "#cbe2f3");
color.AddRange("#5db2ff", "#deeffe");
})
)

Configures the DataSource of the TreeMap.

C#
public TreeMapBuilder DataSource(Action<HierarchicalDataSourceBuilder<object>> configurator)
Parameters:configuratorAction<HierarchicalDataSourceBuilder<object>>

The action that configures the DataSource(Action<HierarchicalDataSourceBuilder<object>>).

Returns:

TreeMapBuilder

Returns the current TreeMapBuilder instance.

Example:
C#
@(Html.Kendo().TreeMap()
.Name("treeMap")
.DataSource(dataSource =&gt; dataSource
.Read(read =&gt; read.Action("ActionName", "ControllerName"))
.Model(m =&gt; m.Children("Items"))
)
)

Configures the client-side events.

C#
public TreeMapBuilder Events(Action<TreeMapEventBuilder> configurator)
Parameters:configuratorAction<TreeMapEventBuilder>

The client events action.

Returns:

TreeMapBuilder

Returns the current TreeMapBuilder instance.

Example:
C#
@(Html.Kendo().TreeMap()
.Name("TreeMap")
.Events(events =&gt; events
.ItemCreated("onItemCreated")
)
)

The template which renders the treeMap tile content.The fields which can be used in the template are: dataItem - the original data item used to construct the point. or text - the original tile text..

C#
public TreeMapBuilder Template(string value)
Parameters:valuestring

The value for Template

Returns:

TreeMapBuilder

Returns the current TreeMapBuilder instance.

Example:
C#
@(Html.Kendo().TreeMap()
.Name("treeMap")
.Template(Html.Kendo().Template().AddHtml("&lt;h2&gt;${data.text}: ${data.dataItem.value}&lt;/h2&gt;"))
)

The template which renders the treeMap tile content.The fields which can be used in the template are: dataItem - the original data item used to construct the point. or text - the original tile text..

C#
public TreeMapBuilder Template<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the template.

Returns:

TreeMapBuilder

Returns the current TreeMapBuilder instance.

The template which renders the treeMap tile content.The fields which can be used in the template are: dataItem - the original data item used to construct the point. or text - the original tile text..

C#
public TreeMapBuilder TemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for Template

Returns:

TreeMapBuilder

Returns the current TreeMapBuilder instance.

Example:
C#
@(Html.Kendo().TreeMap()
.Name("treeMap")
.TemplateHandler("getTileTemplate")
)
&lt;script&gt;
function getTileTemplate(data) {
return `&lt;h2&gt;${data.text}: ${data.dataItem.value}&lt;/h2&gt;`;
}
&lt;/script&gt;

The template which renders the treeMap tile content.The fields which can be used in the template are: dataItem - the original data item used to construct the point. or text - the original tile text..

C#
public TreeMapBuilder TemplateId(string templateId)
Parameters:templateIdstring

The ID of the template element for Template

Returns:

TreeMapBuilder

Returns the current TreeMapBuilder instance.

Example:
C#
@(Html.Kendo().TreeMap()
.Name("treeMap")
.TemplateId("tileTemplate")
)
&lt;script id="tileTemplate" type="text/x-kendo-template"&gt;
&lt;h2&gt;#=text#: #=dataItem.value#&lt;/h2&gt;
&lt;/script&gt;

The template which renders the treeMap tile content.The fields which can be used in the template are: dataItem - the original data item used to construct the point. or text - the original tile text..

C#
public TreeMapBuilder TemplateView(IHtmlContent templateView)
Parameters:templateViewIHtmlContent

The view that contains the template for Template

Returns:

TreeMapBuilder

Returns the current TreeMapBuilder instance.

Example:
C#
@(Html.Kendo().TreeMap()
.Name("treeMap")
.TemplateView(Html.Partial("TileTemplateView"))
)

The data item field which contains the tile title.

C#
public TreeMapBuilder TextField(string value)
Parameters:valuestring

The value for TextField

Returns:

TreeMapBuilder

Returns the current TreeMapBuilder instance.

Example:
C#
@(Html.Kendo().TreeMap()
.Name("treeMap")
.TextField("TitleTile")
.DataSource(dataSource =&gt; dataSource
.Read(read =&gt; read.Action("ActionName", "ControllerName"))
.Model(m =&gt; m.Children("Items"))
)
)

The theme of the TreeMap.Note: Since Q2 2024 release, the default value for the theme property is "sass" instead of "default". It is recommended to use "sass" with version Q2 2024 or later.

C#
public TreeMapBuilder Theme(string value)
Parameters:valuestring

The value for Theme

Returns:

TreeMapBuilder

Returns the current TreeMapBuilder instance.

Example:
C#
@(Html.Kendo().TreeMap()
.Name("treeMap")
.Theme("sass")
)

The layout type for the Treemap.

C#
public TreeMapBuilder Type(TreeMapType value)
Parameters:valueTreeMapType

The value for Type

Returns:

TreeMapBuilder

Returns the current TreeMapBuilder instance.

Example:
C#
@(Html.Kendo().TreeMap()
.Name("treeMap")
.Type(TreeMapType.Horizontal)
)

The data item field which contains the tile value.

C#
public TreeMapBuilder ValueField(string value)
Parameters:valuestring

The value for ValueField

Returns:

TreeMapBuilder

Returns the current TreeMapBuilder instance.

Example:
C#
@(Html.Kendo().TreeMap()
.Name("treeMap")
.ValueField("TileValue")
.DataSource(dataSource =&gt; dataSource
.Read(read =&gt; read.Action("ActionName", "ControllerName"))
.Model(m =&gt; m.Children("Items"))
)
)