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

Defines the fluent API for configuring the Kendo UI OrgChart

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Type Parameters:

T

Syntax:

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

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

Implements: IHtmlContent

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

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

Methods

Binds the OrgChart to an IEnumerable collection.

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

The data collection.

Returns:

OrgChartBuilder<T>

Returns the current OrgChartBuilder<T> instance.

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>

Returns the current OrgChartBuilder<T> instance.

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>

Returns the current OrgChartBuilder<T> instance.

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>

Returns the current OrgChartBuilder<T> instance.

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>

Returns the current OrgChartBuilder<T> instance.

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.The editable option can also be set to a JavaScript object (which represents the editing configuration).

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

The OrgChartEditableSettingsBuilder<T> for the editable setting.

Returns:

OrgChartBuilder<T>

Returns the current instance of OrgChartBuilder<T> .

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.The editable option can also be set to a JavaScript object (which represents the editing configuration).

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

Enables or disables the editable option.

Returns:

OrgChartBuilder<T>

Returns the current instance of OrgChartEditableSettingsBuilder<T> .

Configures the client-side events.

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

The client events action.

Returns:

OrgChartBuilder<T>

Returns the current OrgChartBuilder<T> instance.

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 for GroupField

Returns:

OrgChartBuilder<T>

Returns the current OrgChartBuilder<T> instance.

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 for GroupHeaderTemplate

Returns:

OrgChartBuilder<T>

Returns the current OrgChartBuilder<T> instance.

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>

Returns the current OrgChartBuilder<T> instance.

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 templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for GroupHeaderTemplate

Returns:

OrgChartBuilder<T>

Returns the current OrgChartBuilder<T> instance.

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 templateId)
Parameters:templateIdstring

The ID of the template element for GroupHeaderTemplate

Returns:

OrgChartBuilder<T>

Returns the current OrgChartBuilder<T> instance.

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(IHtmlContent templateView)
Parameters:templateViewIHtmlContent

The view that contains the template for GroupHeaderTemplate

Returns:

OrgChartBuilder<T>

Returns the current OrgChartBuilder<T> instance.

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 OrgChartMessagesSettingsBuilder<T> for the messages setting.

Returns:

OrgChartBuilder<T>

Returns the current instance of OrgChartBuilder<T> .

Defines a node card template.

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

The value for Template

Returns:

OrgChartBuilder<T>

Returns the current OrgChartBuilder<T> instance.

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>

Returns the current OrgChartBuilder<T> instance.

Defines a node card template.

C#
public OrgChartBuilder<T> TemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for Template

Returns:

OrgChartBuilder<T>

Returns the current OrgChartBuilder<T> instance.

Defines a node card template.

C#
public OrgChartBuilder<T> TemplateId(string templateId)
Parameters:templateIdstring

The ID of the template element for Template

Returns:

OrgChartBuilder<T>

Returns the current OrgChartBuilder<T> instance.

Defines a node card template.

C#
public OrgChartBuilder<T> TemplateView(IHtmlContent templateView)
Parameters:templateViewIHtmlContent

The view that contains the template for Template

Returns:

OrgChartBuilder<T>

Returns the current OrgChartBuilder<T> instance.