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

PanelBarBuilder

Defines the fluent API for configuring the Kendo UI PanelBar

Properties

WriteAction - Func

Methods

Items(System.Action)

Defines the items in the panelbar

Parameters

addAction - System.Action<PanelBarItemFactory>

The add action.

Example


             @( Html.Kendo().PanelBar()
                        .Name("PanelBar")
                        .Items(items =>
                        {
                            items.Add().Text("First Item");
                            items.Add().Text("Second Item");
                        }))

DataSource(System.Action)

Configure the DataSource of the component

Parameters

configurator - System.Action<HierarchicalDataSourceBuilder>

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

Example


             @( Html.Kendo().PanelBar()
                .Name("PanelBar")
                .DataSource(dataSource => dataSource
                    .Read(read => read
                        .Action("Employees", "PanelBar")
                    )))

DataSource(System.String)

Set ID of the DataSource that to be used for data binding

Parameters

dataSourceId - System.String

BindTo(System.Collections.Generic.IEnumerable)

Binds the PanelBar to a list of items. Use if a hierarchy of items is being sent from the controller; to bind the PanelBar declaratively, use the Items() method.

Parameters

items - System.Collections.Generic.IEnumerable<PanelBarItemModel>

The list of items

Example


             @( Html.Kendo().PanelBar()
                        .Name("PanelBar")
                        .BindTo(model))

BindTo(System.Collections.IEnumerable,System.Action)

Binds the PanelBar to a list of objects. The PanelBar will create a hierarchy of items using the specified mappings.

Parameters

dataSource - System.Collections.IEnumerable

The data source.

factoryAction - System.Action<NavigationBindingFactory>

The action which will configure the mappings

Example


             @( Html.Kendo().PanelBar()
                        .Name("PanelBar")
                        .BindTo(Model, mapping => mapping
                                .For<Customer>(binding => binding
                                    .Children(c => c.Orders) // The "child" items will be bound to the the "Orders" property
                                    .ItemDataBound((item, c) => item.Text = c.ContactName) // Map "Customer" properties to PanelBarItem properties
                                )
                                .For<Order<(binding => binding
                                    .Children(o => null) // "Orders" do not have child objects so return "null"
                                    .ItemDataBound((item, o) => item.Text = o.OrderID.ToString()) // Map "Order" properties to PanelBarItem properties
                                )))

BindTo(System.Collections.Generic.IEnumerable,System.Action)

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.

Parameters

dataSource - System.Collections.Generic.IEnumerable<T>

The data source.

itemDataBound - System.Action<PanelBarItem,T>

The action executed for every data bound item.

Example


             @( Html.Kendo().PanelBar()
                        .Name("PanelBar")
                        .BindTo(new []{"First", "Second"}, (item, value) =>
                        {
                           item.Text = value;
                        }))

Animation(System.Boolean)

Configures the animation effects of the panelbar.

Parameters

enable - System.Boolean

Whether the component animation is enabled.

Example


             @(Html.Kendo().PanelBar()
                        .Name("PanelBar")
                        .Animation(false))

Animation(System.Action)

Configures the animation effects of the panelbar.

Parameters

animationAction - System.Action<ExpandableAnimationBuilder>

The action that configures the animation.

Example


             @(Html.Kendo().PanelBar()
                        .Name("PanelBar")
                        .Animation(animation => animation.Expand(config => config.Fade(FadeDirection.In))))

ItemAction(System.Action)

Callback for each item.

Parameters

action - System.Action<PanelBarItem>

Example


             @( Html.Kendo().PanelBar()
                        .Name("PanelBar")
                        .ItemAction(item =>
                        {
                            item
                                .Text(...)
                                .HtmlAttributes(...);
                        }))

HighlightPath(System.Boolean)

Select item depending on the current URL.

Parameters

value - System.Boolean

If true the item will be highlighted.

Example


             @( Html.Kendo().PanelBar()
                        .Name("PanelBar")
                        .HighlightPath(true))

ExpandAll(System.Boolean)

Renders the panelbar with expanded items.

Parameters

value - System.Boolean

If true the panelbar will be expanded.

Example


             @( Html.Kendo().PanelBar()
                        .Name("PanelBar")
                        .ExpandAll(true))

SelectedIndex(System.Int32)

Selects the item at the specified index.

Parameters

index - System.Int32

The index.

Example


             @( Html.Kendo().PanelBar()
                        .Name("PanelBar")
                        .Items(items =>
                        {
                            items.Add().Text("First Item");
                            items.Add().Text("Second Item");
                        })
                        .SelectedIndex(1))

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

DataImageUrlField(System.String)

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

Parameters

value - System.String

The value for DataImageUrlField

DataSpriteCssClassField(System.String)

Sets the field of the data item that provides the sprite CSS class of the nodes. If an array, each level uses the field that is at the same index in the array, or the last item in the array.

Parameters

value - System.String

The value for DataSpriteCssClassField

DataTextField(System.String[])

Sets the field of the data item that provides the text content of the nodes. If an array, each level uses the field that is at the same index in the array, or the last item in the array.

Parameters

value - System.String[]

The value for DataTextField

DataUrlField(System.String)

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

Parameters

value - System.String

The value for DataUrlField

LoadOnDemand(System.Boolean)

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.

Parameters

value - System.Boolean

The value for LoadOnDemand

Messages(System.Action)

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

Parameters

configurator - System.Action<PanelBarMessagesSettingsBuilder>

The configurator for the messages setting.

Template(System.String)

Template for rendering each node.

Parameters

value - System.String

The value for Template

TemplateId(System.String)

Template for rendering each node.

Parameters

templateId - System.String

The ID of the template element for Template

ExpandMode(Kendo.Mvc.UI.PanelBarExpandMode)

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

Parameters

value - PanelBarExpandMode

The value for ExpandMode

Events(System.Action)

Configures the client-side events.

Parameters

configurator - System.Action<PanelBarEventBuilder>

The client events action.

Example


            @(Html.Kendo().PanelBar()
                  .Name("PanelBar")
                  .Events(events => events
                      .Activate("onActivate")
                  )
            )

ToComponent()

Returns the internal view component.

Expression(System.String)

Sets the name of the component.

Parameters

modelExpression - System.String

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

Sets the name of the component.

Parameters

modelExplorer - Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer

Name(System.String)

Sets the name of the component.

Parameters

componentName - System.String

The name.

Deferred(System.Boolean)

Suppress initialization script rendering. Note that this options should be used in conjunction with

Parameters

deferred - System.Boolean

HtmlAttributes(System.Object)

Sets the HTML attributes.

Parameters

attributes - System.Object

The HTML attributes.

HtmlAttributes(System.Collections.Generic.IDictionary)

Sets the HTML attributes.

Parameters

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

The HTML attributes.

Render()

Renders the component in place.

ToHtmlString()

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

Parameters

writer - System.IO.TextWriter
encoder - System.Text.Encodings.Web.HtmlEncoder

ToClientTemplate()

In this article
Not finding the help you need?