# TreeMapBuilder

## Properties

### WriteAction - Func

## Methods

### DataSource(System.Action)

Configures the DataSource of the TreeMap.

#### Parameters

##### configurator - System.Action<[HierarchicalDataSourceBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/hierarchicaldatasourcebuilder)>

The action that configures the Kendo.Mvc.UI.Fluent.TreeMapBuilder.DataSource(System.Action{Kendo.Mvc.UI.Fluent.HierarchicalDataSourceBuilder{System.Object}}).

#### RETURNS

Returns the current [TreeMapBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/treemapbuilder) instance.

#### Example

```
 
             @(Html.Kendo().TreeMap()
                .Name("treeMap")
                .DataSource(dataSource => dataSource
                    .Read(read => read.Action("ActionName", "ControllerName"))
                    .Model(m => m.Children("Items"))
                )
             )
             
```

### Colors(System.Action)

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

#### Parameters

##### configurator - System.Action<[TreeMapColorRangeFactory](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/treemapcolorrangefactory)>

The action that configures the colors.

#### RETURNS

Returns the current [TreeMapBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/treemapbuilder) instance.

#### Example

```
 
             @(Html.Kendo().TreeMap()
                .Name("treeMap")
                .Colors(color =>
                {
                    color.AddRange("#0072c6", "#cbe2f3");
                    color.AddRange("#5db2ff", "#deeffe");
                })
             )
             
```

### AutoBind(System.Boolean)

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.

#### Parameters

##### value - `System.Boolean`

The value for AutoBind

#### RETURNS

Returns the current [TreeMapBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/treemapbuilder) instance.

#### Example

```
 
            @(Html.Kendo().TreeMap()
                .Name("treeMap")
                .AutoBind(false)
                .DataSource(...)
             )
             
```

### Theme(System.String)

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.

#### Parameters

##### value - `System.String`

The value for Theme

#### RETURNS

Returns the current [TreeMapBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/treemapbuilder) instance.

#### Example

```
 
            @(Html.Kendo().TreeMap()
                .Name("treeMap")
                .Theme("sass")
             )
             
```

### ValueField(System.String)

The data item field which contains the tile value.

#### Parameters

##### value - `System.String`

The value for ValueField

#### RETURNS

Returns the current [TreeMapBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/treemapbuilder) instance.

#### Example

```
 
            @(Html.Kendo().TreeMap()
                .Name("treeMap")
                .ValueField("TileValue")
                .DataSource(dataSource => dataSource
                    .Read(read => read.Action("ActionName", "ControllerName"))
                    .Model(m => m.Children("Items"))
                )
             )
             
```

### ColorField(System.String)

The data item field which contains the tile color.

#### Parameters

##### value - `System.String`

The value for ColorField

#### RETURNS

Returns the current [TreeMapBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/treemapbuilder) instance.

#### Example

```
 
            @(Html.Kendo().TreeMap()
                .Name("treeMap")
                .ColorField("color")
                .DataSource(dataSource => dataSource
                    .Read(read => read.Action("ActionName", "ControllerName"))
                    .Model(m => m.Children("Items"))
                )
             )
             
```

### TextField(System.String)

The data item field which contains the tile title.

#### Parameters

##### value - `System.String`

The value for TextField

#### RETURNS

Returns the current [TreeMapBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/treemapbuilder) instance.

#### Example

```
 
            @(Html.Kendo().TreeMap()
                .Name("treeMap")
                .TextField("TitleTile")
                .DataSource(dataSource => dataSource
                    .Read(read => read.Action("ActionName", "ControllerName"))
                    .Model(m => m.Children("Items"))
                )
             )
             
```

### Template(System.String)

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..

#### Parameters

##### value - `System.String`

The value for Template

#### RETURNS

Returns the current [TreeMapBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/treemapbuilder) instance.

#### Example

```
 
            @(Html.Kendo().TreeMap()
                .Name("treeMap")
                .Template(Html.Kendo().Template().AddHtml("<h2>${data.text}: ${data.dataItem.value}</h2>"))
             )
             
```

### TemplateId(System.String)

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..

#### Parameters

##### templateId - `System.String`

The ID of the template element for Template

#### RETURNS

Returns the current [TreeMapBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/treemapbuilder) instance.

#### Example

```
 
            @(Html.Kendo().TreeMap()
                .Name("treeMap")
                .TemplateId("tileTemplate")
             )
            <script id="tileTemplate" type="text/x-kendo-template">
                <h2>#=text#: #=dataItem.value#</h2>
            </script>
             
```

### TemplateView(Microsoft.AspNetCore.Html.IHtmlContent)

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..

#### Parameters

##### templateView - `Microsoft.AspNetCore.Html.IHtmlContent`

The view that contains the template for Template

#### RETURNS

Returns the current [TreeMapBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/treemapbuilder) instance.

#### Example

```
 
            @(Html.Kendo().TreeMap()
                .Name("treeMap")
                .TemplateView(Html.Partial("TileTemplateView"))
             )
             
```

### TemplateHandler(System.String)

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..

#### Parameters

##### templateHandler - `System.String`

The handler that returs the template for Template

#### RETURNS

Returns the current [TreeMapBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/treemapbuilder) instance.

#### Example

```
 
            @(Html.Kendo().TreeMap()
                .Name("treeMap")
                .TemplateHandler("getTileTemplate")
             )
            <script>
                function getTileTemplate(data) {
                    return `<h2>${data.text}: ${data.dataItem.value}</h2>`;
                }
            </script>
             
```

### Template(Kendo.Mvc.UI.Fluent.TemplateBuilder)

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..

#### Parameters

##### template - TemplateBuilder\<TModel>

A Template component that configures the template.

#### RETURNS

Returns the current [TreeMapBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/treemapbuilder) instance.

### Colors(System.String\[])

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.

#### Parameters

##### value - `System.String[]`

The value for Colors

#### RETURNS

Returns the current [TreeMapBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/treemapbuilder) instance.

#### Example

```
 
            @(Html.Kendo().TreeMap()
                .Name("treeMap")
                .Colors(color =>
                {
                    color.AddRange("#0072c6", "#cbe2f3");
                    color.AddRange("#5db2ff", "#deeffe");
                })
             )
             
```

### Type(Kendo.Mvc.UI.TreeMapType)

The layout type for the Treemap.

#### Parameters

##### value - [TreeMapType](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui/treemaptype)

The value for Type

#### RETURNS

Returns the current [TreeMapBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/treemapbuilder) instance.

#### Example

```
 
            @(Html.Kendo().TreeMap()
                .Name("treeMap")
                .Type(TreeMapType.Horizontal)
             )
             
```

### Events(System.Action)

Configures the client-side events.

#### Parameters

##### configurator - System.Action<[TreeMapEventBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/treemapeventbuilder)>

The client events action.

#### RETURNS

Returns the current [TreeMapBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/treemapbuilder) instance.

#### Example

```
 
            @(Html.Kendo().TreeMap()
                  .Name("TreeMap")
                  .Events(events => events
                      .ItemCreated("onItemCreated")
                  )
            )
             
```

### ToComponent()

Returns the internal view component.

#### RETURNS

The  instance that represents the component.

### Expression(System.String)

Sets the name of the component.

#### Parameters

##### modelExpression - `System.String`

The name.

#### RETURNS

Returns the current  instance.

### Explorer(Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer)

Sets the name of the component.

#### Parameters

##### modelExplorer - `Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer`

The name.

#### RETURNS

Returns the current  instance.

### Name(System.String)

Sets the name of the component.

#### Parameters

##### componentName - `System.String`

The name.

#### RETURNS

Returns the current  instance.

### Deferred(System.Boolean)

Suppress initialization script rendering. Note that this options should be used in conjunction with Kendo.Mvc.UI.Fluent.WidgetFactory.DeferredScripts(System.Boolean,System.Boolean)

#### Parameters

##### deferred - `System.Boolean`

#### RETURNS

Returns a [DeferredWidgetBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/deferredwidgetbuilder) instance.

### HtmlAttributes(System.Object)

Sets the HTML attributes.

#### Parameters

##### attributes - `System.Object`

The HTML attributes.

#### RETURNS

Returns the current  instance.

### HtmlAttributes(System.Collections.Generic.IDictionary)

Sets the HTML attributes.

#### Parameters

##### attributes - `System.Collections.Generic.IDictionary<String,Object>`

The HTML attributes.

#### RETURNS

Returns the current  instance.

### ScriptAttributes(System.Object,System.Boolean)

Sets the JavaScript attributes to the initialization script.

#### Parameters

##### attributes - `System.Object`

The JavaScript attributes.

##### overrideAttributes - `System.Boolean`

Argument which determines whether attributes should be overriden.

#### RETURNS

Returns the current  instance.

### ScriptAttributes(System.Collections.Generic.IDictionary,System.Boolean)

Sets the JavaScript attributes to the initialization script.

#### Parameters

##### attributes - `System.Collections.Generic.IDictionary<String,Object>`

The JavaScript attributes.

##### overrideAttributes - `System.Boolean`

Argument which determines whether attributes should be overriden.

#### RETURNS

Returns the current  instance.

### Render()

Renders the component in place.

### ToHtmlString()

Returns the HTML representation of the component.

### WriteTo(System.IO.TextWriter,System.Text.Encodings.Web.HtmlEncoder)

#### Parameters

##### writer - `System.IO.TextWriter`

##### encoder - `System.Text.Encodings.Web.HtmlEncoder`

### ToClientTemplate()

Returns the client template for the component.

### AsModule(System.Boolean)

Specifies whether the initialization script of the component will be rendered as a JavaScript module.

#### Parameters

##### value - `System.Boolean`

#### RETURNS

Returns the current  instance.
