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

Defines the fluent interface for configuring the PanelBar component.

Definition

Constructors

Initializes a new instance of the PanelBarBuilder class.

C#
public PanelBarBuilder(PanelBar component)
Parameters:componentPanelBar

The component.

Methods

Configures the visual animations of the PanelBar.

C#
public PanelBarBuilder Animation(Action<ExpandableAnimationBuilder> animationAction)
Parameters:animationActionAction<ExpandableAnimationBuilder>

The action that configures the animation.

Returns:

PanelBarBuilder

Example:
C#
@( Html.Kendo().PanelBar()
.Name("PanelBar")
.Animation(animation =&gt; animation.Expand(config =&gt; config.Fade(FadeDirection.In)))
)

Configures the visual animations of the PanelBar.

C#
public PanelBarBuilder Animation(bool enable)
Parameters:enablebool

The boolean value.

Returns:

PanelBarBuilder

Example:
C#
@( Html.Kendo().PanelBar()
.Name("PanelBar")
.Animation(false)
)

Controls whether to bind the PanelBar to the DataSource during its initialization.

C#
public PanelBarBuilder AutoBind(bool autoBind)
Parameters:autoBindbool

The boolean value.

Returns:

PanelBarBuilder

Example:
C#
@(Html.Kendo().PanelBar()
.Name("PanelBar")
.AutoBind(false)
)
C#
public PanelBarBuilder BindTo(IEnumerable dataSource, Action<NavigationBindingFactory<PanelBarItem>> factoryAction)
Parameters:dataSourceIEnumerablefactoryActionAction<NavigationBindingFactory<PanelBarItem>>Returns:

PanelBarBuilder

C#
public PanelBarBuilder BindTo(IEnumerable<PanelBarItemModel> items)
Parameters:itemsIEnumerable<PanelBarItemModel>Returns:

PanelBarBuilder

Binds the PanelBar to a sitemap.

C#
public PanelBarBuilder BindTo(string viewDataKey, Action<PanelBarItem, SiteMapNode> siteMapAction)
Parameters:viewDataKeystring

The view data key.

siteMapActionAction<PanelBarItem, SiteMapNode>

The action to configure the item.

Returns:

PanelBarBuilder

Example:
C#
@(Html.Kendo().PanelBar()
.Name("PanelBar")
.BindTo("examples", (item, siteMapNode) =&gt;
{
})
)

Binds the PanelBar to a sitemap.

C#
public PanelBarBuilder BindTo(string viewDataKey)
Parameters:viewDataKeystring

The view data key.

Returns:

PanelBarBuilder

Example:
C#
@( Html.Kendo().PanelBar()
.Name("PanelBar")
.BindTo("examples")
)

Binds the PanelBar to a list of objects. The PanelBar will be "flat", which means a PanelBar item will be created for every item in the data source.

C#
public PanelBarBuilder BindTo<T>(IEnumerable<T> dataSource, Action<PanelBarItem, T> itemDataBound)
Parameters:dataSourceIEnumerable<T>

The data source.

itemDataBoundAction<PanelBarItem, T>

The action executed for every data bound item.

Returns:

PanelBarBuilder

Example:
C#
@( Html.Kendo().PanelBar()
.Name("PanelBar")
.BindTo(new []{"First", "Second"}, (item, value) =&gt;
{
item.Text = value;
}))

Sets the field of the data item that provides the icon content of the items.

C#
public PanelBarBuilder DataIconClassField(string value)
Parameters:valuestring

The value that configures the dataiconclassfield.

Returns:

PanelBarBuilder

Example:
C#
@( Html.Kendo().PanelBar()
.Name("PanelBar")
.Items(items =&gt;
{
items.Add().Text("First Item");
items.Add().Text("Second Item");
})
.DataIconClassField("k-i-pencil")
)

Sets the field of the data item that provides the icon content of the items.

C#
public PanelBarBuilder DataIconField(string value)
Parameters:valuestring

The value that configures the dataiconfield.

Returns:

PanelBarBuilder

Example:
C#
@( Html.Kendo().PanelBar()
.Name("PanelBar")
.Items(items =&gt;
{
items.Add().Text("First Item");
items.Add().Text("Second Item");
})
.DataIconField("pencil")
)

Sets the field of the data item that provides the image URL of the PanelBar items.

C#
public PanelBarBuilder DataImageUrlField(string value)
Parameters:valuestring

The value that configures the dataimageurlfield.

Returns:

PanelBarBuilder

Example:
C#
@(Html.Kendo().PanelBar()
.Name("PanelBar")
.DataImageUrlField("UserImage")
.DataSource(dataSource =&gt; dataSource
.Read(read =&gt; read.Action("Employees", "PanelBar"))
)
)

Configures the DataSource of the component for remote data binding.

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

The action that configures the DataSource.

Returns:

PanelBarBuilder

Example:
C#
@(Html.Kendo().PanelBar()
.Name("PanelBar")
.DataSource(dataSource =&gt; dataSource
.Read(read =&gt; read.Action("Employees", "PanelBar"))
)
)
C#
public PanelBarBuilder DataSource(string dataSourceId)
Parameters:dataSourceIdstringReturns:

PanelBarBuilder

Sets the field of the data item that provides the sprite CSS class of the items.

C#
public PanelBarBuilder DataSpriteCssClassField(string value)
Parameters:valuestring

The value that configures the dataspritecssclassfield.

Returns:

PanelBarBuilder

Example:
C#
@(Html.Kendo().PanelBar()
.Name("PanelBar")
.DataSpriteCssClassField("spriteProperty")
.DataSource(dataSource =&gt; dataSource
.Read(read =&gt; read.Action("Employees", "PanelBar"))
)
)

Sets the field of the data item that provides the text content of the items.

C#
public PanelBarBuilder DataTextField(params string[] value)
Parameters:valuestring[]

The value that configures the datatextfield.

Returns:

PanelBarBuilder

Example:
C#
@(Html.Kendo().PanelBar()
.Name("PanelBar")
.DataTextField("Name")
.DataSource(dataSource =&gt; dataSource
.Read(read =&gt; read.Action("Employees", "PanelBar"))
)
)

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

C#
public PanelBarBuilder DataUrlField(string value)
Parameters:valuestring

The value that configures the dataurlfield.

Returns:

PanelBarBuilder

Example:
C#
@(Html.Kendo().PanelBar()
.Name("PanelBar")
.DataUrlField("urlProperty")
.DataSource(dataSource =&gt; dataSource
.Read(read =&gt; read.Action("Employees", "PanelBar"))
)
)

Configures the client-side event handlers.

C#
public PanelBarBuilder Events(Action<PanelBarEventBuilder> clientEventsAction)
Parameters:clientEventsActionAction<PanelBarEventBuilder>

The client events action.

Returns:

PanelBarBuilder

Example:
C#
@(Html.Kendo().PanelBar()
.Name("PanelBar")
.Events(events =&gt;
events.Expand("expand").Collapse("collapse")
)
)

Renders the PanelBar with expanded items.

C#
public PanelBarBuilder ExpandAll(bool value)
Parameters:valuebool

The boolean value.

Returns:

PanelBarBuilder

Example:
C#
@( Html.Kendo().PanelBar()
.Name("PanelBar")
.ExpandAll(true)
)

Specifies how the PanelBar items are displayed when opened and closed.

C#
public PanelBarBuilder ExpandMode(PanelBarExpandMode value)
Parameters:valuePanelBarExpandMode

The desired expand mode.

Returns:

PanelBarBuilder

Example:
C#
@( Html.Kendo().PanelBar()
.Name("PanelBar")
.ExpandMode(PanelBarExpandMode.Multiple)
)

Selects the item depending on the current URL.

C#
public PanelBarBuilder HighlightPath(bool value)
Parameters:valuebool

The boolean value.

Returns:

PanelBarBuilder

Example:
C#
@( Html.Kendo().PanelBar()
.Name("PanelBar")
.HighlightPath(true)
)

Defines the callback for each item.

C#
public PanelBarBuilder ItemAction(Action<PanelBarItem> action)
Parameters:actionAction<PanelBarItem>

Action, which will be executed for each item.

Returns:

PanelBarBuilder

Example:
C#
@( Html.Kendo().PanelBar()
.Name("PanelBar")
.ItemAction(item =&gt;
{
item
.Text(...)
.HtmlAttributes(...);
})
)

Defines the items within the PanelBar declaration.

C#
public PanelBarBuilder Items(Action<PanelBarItemFactory> addAction)
Parameters:addActionAction<PanelBarItemFactory>

The add action.

Returns:

PanelBarBuilder

Example:
C#
@( Html.Kendo().PanelBar()
.Name("PanelBar")
.Items(items =&gt;
{
items.Add().Text("First Item");
items.Add().Text("Second Item");
})
)

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 PanelBarBuilder LoadOnDemand(bool value)
Parameters:valuebool

The boolean value.

Returns:

PanelBarBuilder

Example:
C#
@( Html.Kendo().PanelBar()
.Name("PanelBar")
.LoadOnDemand(false)
)

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

C#
public PanelBarBuilder Messages(Action<PanelBarMessagesSettingsBuilder> configurator)
Parameters:configuratorAction<PanelBarMessagesSettingsBuilder>

The action that configures the messages.

Returns:

PanelBarBuilder

Example:
C#
@(Html.Kendo().PanelBar()
.Name("PanelBar")
.Messages(msg =&gt; msg.Loading("loading..."))
)

Defines the security trimming functionality of the component.

C#
public PanelBarBuilder SecurityTrimming(Action<SecurityTrimmingBuilder> securityTrimmingAction)
Parameters:securityTrimmingActionAction<SecurityTrimmingBuilder>

The securityTrimming action.

Returns:

PanelBarBuilder

Example:
C#
@( Html.Kendo().PanelBar()
.Name("PanelBar")
.SecurityTrimming(builder =&gt;
{
builder.Enabled(true).HideParent(true);
})
)

Enables/disables the security trimming functionality of the component.

C#
public PanelBarBuilder SecurityTrimming(bool value)
Parameters:valuebool

The boolean value.

Returns:

PanelBarBuilder

Example:
C#
@( Html.Kendo().PanelBar()
.Name("PanelBar")
.SecurityTrimming(false)
)

Selects the item at the specified index.

C#
public PanelBarBuilder SelectedIndex(int index)
Parameters:indexint

The index.

Returns:

PanelBarBuilder

Example:
C#
@( Html.Kendo().PanelBar()
.Name("PanelBar")
.Items(items =&gt;
{
items.Add().Text("First Item");
items.Add().Text("Second Item");
})
.SelectedIndex(1)
)

Defines a template for the items rendering.

C#
public PanelBarBuilder Template(string template)
Parameters:templatestring

The template content.

Returns:

PanelBarBuilder

Example:
C#
@(Html.Kendo().PanelBar()
.Name("PanelBar")
.Template("#= item.text #")
)

Defines a template for the items rendering by using client-side handler.

C#
public PanelBarBuilder TemplateHandler(string template)
Parameters:templatestring

The name of the JavaScript function that will return the template content.

Returns:

PanelBarBuilder

Example:
C#
@(Html.Kendo().PanelBar()
.Name("PanelBar")
.TemplateHandler("getItemTemplate")
)

function getItemTemplate(data) {
return `${data.item.text}`;
}

Specifies the "id" of the external Kendo UI template used for rendering the PanelBar items.

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

The value of the template "id".

Returns:

PanelBarBuilder

Example:
C#
@(Html.Kendo().PanelBar()
.Name("PanelBar")
.TemplateId("panelbar-template")
)

#: item.text #

Defines a template for the items rendering by using a partial View.

C#
public PanelBarBuilder TemplateView(MvcHtmlString template)
Parameters:templateMvcHtmlString

The partial View name.

Returns:

PanelBarBuilder

Example:
C#
@(Html.Kendo().PanelBar()
.Name("PanelBar")
.TemplateView(Html.Partial("panelbar-template-view"))
)