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

Defines the fluent API for configuring the Kendo OrgChart for ASP.NET MVC.

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Type Parameters:

T

Syntax:

C#
public class OrgChartBuilder<T> : WidgetBuilderBase<OrgChart<T>, OrgChartBuilder<T>>, IHtmlString where T : class

Inheritance: objectWidgetBuilderBase<OrgChart<T>, OrgChartBuilder<T>>OrgChartBuilder<T>

Implements: IHtmlString

Inherited Members WidgetBuilderBase<OrgChart<T>, OrgChartBuilder<T>>.ToComponent()WidgetBuilderBase<OrgChart<T>, OrgChartBuilder<T>>.Name(string)WidgetBuilderBase<OrgChart<T>, OrgChartBuilder<T>>.Deferred(bool)WidgetBuilderBase<OrgChart<T>, OrgChartBuilder<T>>.ModelMetadata(ModelMetadata)WidgetBuilderBase<OrgChart<T>, OrgChartBuilder<T>>.HtmlAttributes(object)WidgetBuilderBase<OrgChart<T>, OrgChartBuilder<T>>.HtmlAttributes(IDictionary<string, object>)WidgetBuilderBase<OrgChart<T>, OrgChartBuilder<T>>.AsModule(bool)WidgetBuilderBase<OrgChart<T>, OrgChartBuilder<T>>.Render()WidgetBuilderBase<OrgChart<T>, OrgChartBuilder<T>>.ScriptAttributes(object, bool)WidgetBuilderBase<OrgChart<T>, OrgChartBuilder<T>>.ScriptAttributes(IDictionary<string, object>, bool)WidgetBuilderBase<OrgChart<T>, OrgChartBuilder<T>>.ToHtmlString()WidgetBuilderBase<OrgChart<T>, OrgChartBuilder<T>>.ToClientTemplate()WidgetBuilderBase<OrgChart<T>, OrgChartBuilder<T>>.ToString()WidgetBuilderBase<OrgChart<T>, OrgChartBuilder<T>>.Componentobject.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 OrgChart class.

C#
public OrgChartBuilder(OrgChart<T> component)
Parameters:componentOrgChart<T>

The component.

Methods

Binds the OrgChart to an IEnumerable collection.

C#
public OrgChartBuilder<T> BindTo(IEnumerable data)
Parameters:dataIEnumerable

The data collection.

Returns:

OrgChartBuilder<T>

Example:
C#
@(Html.Kendo().OrgChart&lt;EmployeeViewModel&gt;()
.Name("orgchart")
.BindTo((IEnumerable)ViewData["Employees"])
)

Binds the OrgChart to an IEnumerable collection.

C#
public OrgChartBuilder<T> BindTo(IEnumerable<T> data)
Parameters:dataIEnumerable<T>

The data collection.

Returns:

OrgChartBuilder<T>

Example:
C#
@(Html.Kendo().OrgChart&lt;EmployeeViewModel&gt;()
.Name("orgchart")
.BindTo((IEnumerable&lt;EmployeeViewModel&gt;) ViewData["Employees"])
)

Defines the colors that will be shown in the cards.

C#
public OrgChartBuilder<T> CardsColors(string[] value)
Parameters:valuestring[]

A collection of card colors.

Returns:

OrgChartBuilder<T>

Example:
C#
@(Html.Kendo().OrgChart&lt;EmployeeViewModel&gt;()
.Name("orgchart")
.CardsColors(new string[] {"pink", "blue", "orange"})
)

Configures the DataSource that will render the OrgChart items.

C#
public OrgChartBuilder<T> DataSource(Action<OrgChartAjaxDataSourceBuilder<T>> configurator)
Parameters:configuratorAction<OrgChartAjaxDataSourceBuilder<T>>

The value that configures the datasource.

Returns:

OrgChartBuilder<T>

Example:
C#
@(Html.Kendo().OrgChart&lt;EmployeeViewModel&gt;()
.Name("orgchart")
.DataSource(dataSource =&gt; dataSource
.Read(r =&gt; r.Action("Read", "Home"))
)
)

Sets an external DataSource instance as a DataSource of the OrgChart.

C#
public OrgChartBuilder<T> DataSource(string dataSourceId)
Parameters:dataSourceIdstring

The id of the data source instance.

Returns:

OrgChartBuilder<T>

Example:
C#
@(Html.Kendo().DataSource&lt;EmployeeViewModel&gt;()
.Name("dataSource1")
...
)
@(Html.Kendo().OrgChart&lt;EmployeeViewModel&gt;()
.Name("orgchart")
.DataSource("dataSource1")
)

If set to false, the user will not be able to edit the data to which the OrgChart is bound. By default, editing is enabled.

C#
public OrgChartBuilder<T> Editable(Action<OrgChartEditableSettingsBuilder<T>> configurator)
Parameters:configuratorAction<OrgChartEditableSettingsBuilder<T>>

The action that configures the editable.

Returns:

OrgChartBuilder<T>

Example:
C#
@(Html.Kendo().OrgChart&lt;EmployeeViewModel&gt;()
.Name("orgchart")
.Editable(editable =&gt; editable.Destroy(false))
)

If set to false, the user will not be able to edit the data to which the OrgChart is bound. By default, editing is enabled.

C#
public OrgChartBuilder<T> Editable(bool enabled)
Parameters:enabledbool

Enables or disables the editable option.

Returns:

OrgChartBuilder<T>

Example:
C#
@(Html.Kendo().OrgChart&lt;EmployeeViewModel&gt;()
.Name("orgchart")
.Editable(false)
)

Configures the client-side events.

C#
public OrgChartBuilder<T> Events(Action<OrgChartEventBuilder> configurator)
Parameters:configuratorAction<OrgChartEventBuilder>

The client events action.

Returns:

OrgChartBuilder<T>

Example:
C#
@( Html.Kendo().OrgChart()
.Name("OrgChart")
.Events(events =&gt; events
.Cancel("onCancel")
)
)

Specifies the field the nodes should be grouped by. If any value is passed, the OrgChart uses its grouping rendering mode.

C#
public OrgChartBuilder<T> GroupField(string value)
Parameters:valuestring

The value that configures the groupfield.

Returns:

OrgChartBuilder<T>

Example:
C#
@(Html.Kendo().OrgChart&lt;EmployeeViewModel&gt;()
.Name("orgchart")
.GroupField("Group")
)

Provides an option to customize the default template for the group label (using the field value and name by default).

C#
public OrgChartBuilder<T> GroupHeaderTemplate(string value)
Parameters:valuestring

The value that configures the groupheadertemplate.

Returns:

OrgChartBuilder<T>

Example:
C#
@(Html.Kendo().OrgChart&lt;EmployeeViewModel&gt;()
.Name("orgchart")
.GroupHeaderTemplate("#: field # - #: value #")
)

Provides an option to customize the default template for the group label (using the field value and name by default).

C#
public OrgChartBuilder<T> GroupHeaderTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the groupheadertemplate.

Returns:

OrgChartBuilder<T>

Provides an option to customize the default template for the group label (using the field value and name by default).

C#
public OrgChartBuilder<T> GroupHeaderTemplateHandler(string value)
Parameters:valuestring

The value that configures the groupheadertemplate.

Returns:

OrgChartBuilder<T>

Example:
C#
@(Html.Kendo().OrgChart&lt;EmployeeViewModel&gt;()
.Name("orgchart")
.GroupHeaderTemplateHandler("headerTemplateHandler")
)

Provides an option to customize the default template for the group label (using the field value and name by default).

C#
public OrgChartBuilder<T> GroupHeaderTemplateId(string value)
Parameters:valuestring

The value that configures the groupheadertemplate.

Returns:

OrgChartBuilder<T>

Example:
C#
@(Html.Kendo().OrgChart&lt;EmployeeViewModel&gt;()
.Name("orgchart")
.GroupHeaderTemplateId("headerTemplate")
)

Provides an option to customize the default template for the group label (using the field value and name by default).

C#
public OrgChartBuilder<T> GroupHeaderTemplateView(MvcHtmlString value)
Parameters:valueMvcHtmlString

The value that configures the groupheadertemplate.

Returns:

OrgChartBuilder<T>

Example:
C#
@(Html.Kendo().OrgChart&lt;EmployeeViewModel&gt;()
.Name("orgchart")
.GroupHeaderTemplateView(Html.Partial("HeaderTemplate"))
)

Provides configuration options for the messages present in the OrgChart widget.

C#
public OrgChartBuilder<T> Messages(Action<OrgChartMessagesSettingsBuilder<T>> configurator)
Parameters:configuratorAction<OrgChartMessagesSettingsBuilder<T>>

The action that configures the messages.

Returns:

OrgChartBuilder<T>

Example:
C#
@(Html.Kendo().OrgChart&lt;EmployeeViewModel&gt;()
.Name("orgchart")
.Messages(m =&gt; m.Destroy("Remove"))
)

Defines a node card template.

C#
public OrgChartBuilder<T> Template(string value)
Parameters:valuestring

The value that configures the template.

Returns:

OrgChartBuilder<T>

Example:
C#
@(Html.Kendo().OrgChart&lt;EmployeeViewModel&gt;()
.Name("orgchart")
.Template("#: Name #")
)

Defines a node card template.

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

A Template component that configures the template.

Returns:

OrgChartBuilder<T>

Defines a node card template.

C#
public OrgChartBuilder<T> TemplateHandler(string value)
Parameters:valuestring

The value that configures the template.

Returns:

OrgChartBuilder<T>

Example:
C#
@(Html.Kendo().OrgChart&lt;EmployeeViewModel&gt;()
.Name("orgchart")
.TemplateHandler("templateHandler")
)

Defines a node card template.

C#
public OrgChartBuilder<T> TemplateId(string value)
Parameters:valuestring

The value that configures the template.

Returns:

OrgChartBuilder<T>

Example:
C#
@(Html.Kendo().OrgChart&lt;EmployeeViewModel&gt;()
.Name("orgchart")
.TemplateId("orgChartTemplate")
)

Defines a node card template.

C#
public OrgChartBuilder<T> TemplateView(MvcHtmlString value)
Parameters:valueMvcHtmlString

The value that configures the template.

Returns:

OrgChartBuilder<T>

Example:
C#
@(Html.Kendo().OrgChart&lt;EmployeeViewModel&gt;()
.Name("orgchart")
.TemplateView(Html.Partial("TemplatePartial"))
)