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

PanelBarBuilder

Methods

Items(System.Action)

Defines the items within the PanelBar declaration.

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");
                        })
            )

AutoBind(System.Boolean)

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

Parameters

autoBind - System.Boolean

The boolean value.

Example


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

Template(System.String)

Defines a template for the items rendering.

Parameters

template - System.String

The template content.

Example


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

TemplateId(System.String)

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

Parameters

templateId - System.String

The value of the template "id".

Example


             @(Html.Kendo().PanelBar()
                .Name("PanelBar")
                .TemplateId("panelbar-template")
             )

TemplateView(System.Web.Mvc.MvcHtmlString)

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

Parameters

template - System.Web.Mvc.MvcHtmlString

The partial View name.

Example


             @(Html.Kendo().PanelBar()
                .Name("PanelBar")
                .TemplateView(Html.Partial("panelbar-template-view"))
             )

TemplateHandler(System.String)

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

Parameters

template - System.String

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

Example


            @(Html.Kendo().PanelBar()
                .Name("PanelBar")
                .TemplateHandler("getItemTemplate")
            )

Events(System.Action)

Configures the client-side event handlers.

Parameters

clientEventsAction - System.Action<PanelBarEventBuilder>

The client events action.

Example


             @(Html.Kendo().PanelBar()
                        .Name("PanelBar")
                        .Events(events =>
                            events.Expand("expand").Collapse("collapse")
                        )
             )

BindTo(System.String,System.Action)

Binds the PanelBar to a sitemap.

Parameters

viewDataKey - System.String

The view data key.

siteMapAction - System.Action<PanelBarItem,SiteMapNode>

The action to configure the item.

Example


             @(Html.Kendo().PanelBar()
                .Name("PanelBar")
                .BindTo("examples", (item, siteMapNode) =>
                {
                })
             )

BindTo(System.String)

Binds the PanelBar to a sitemap.

Parameters

viewDataKey - System.String

The view data key.

Example


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

BindTo(System.Collections.Generic.IEnumerable)

Parameters

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

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;
                        }))

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

Parameters

dataSource - System.Collections.IEnumerable
factoryAction - System.Action<NavigationBindingFactory>

DataSource(System.Action)

Configures the DataSource of the component for remote data binding.

Parameters

configurator - System.Action<HierarchicalDataSourceBuilder>

The action that configures the DataSource.

Example


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

DataSource(System.String)

Parameters

dataSourceId - System.String

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

Example


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

DataImageUrlField(System.String)

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

Parameters

value - System.String

The value that configures the dataimageurlfield.

Example


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

DataSpriteCssClassField(System.String)

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

Parameters

value - System.String

The value that configures the dataspritecssclassfield.

Example


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

DataUrlField(System.String)

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

Parameters

value - System.String

The value that configures the dataurlfield.

Example


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

Messages(System.Action)

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

Parameters

configurator - System.Action<PanelBarMessagesSettingsBuilder>

The action that configures the messages.

Example


             @(Html.Kendo().PanelBar()
                .Name("PanelBar")
                .Messages(msg => msg.Loading("loading..."))
             )

DataTextField(System.String[])

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

Parameters

value - System.String[]

The value that configures the datatextfield.

Example


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

Animation(System.Boolean)

Configures the visual animations of the PanelBar.

Parameters

enable - System.Boolean

The boolean value.

Example


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

Animation(System.Action)

Configures the visual animations 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)

Defines the callback for each item.

Parameters

action - System.Action<PanelBarItem>

Action, which will be executed for each item.

Example


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

HighlightPath(System.Boolean)

Selects the item depending on the current URL.

Parameters

value - System.Boolean

The boolean value.

Example


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

ExpandAll(System.Boolean)

Renders the PanelBar with expanded items.

Parameters

value - System.Boolean

The boolean value.

Example


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

ExpandMode(Kendo.Mvc.UI.PanelBarExpandMode)

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

Parameters

value - PanelBarExpandMode

The desired expand mode.

Example


             @( Html.Kendo().PanelBar()
                        .Name("PanelBar")
                        .ExpandMode(PanelBarExpandMode.Multiple)
            )

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

SecurityTrimming(System.Boolean)

Enables/disables the security trimming functionality of the component.

Parameters

value - System.Boolean

The boolean value.

Example


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

SecurityTrimming(System.Action)

Defines the security trimming functionality of the component.

Parameters

securityTrimmingAction - System.Action<SecurityTrimmingBuilder>

The securityTrimming action.

Example


             @( Html.Kendo().PanelBar()
                        .Name("PanelBar")
                        .SecurityTrimming(builder =>
                        {
                            builder.Enabled(true).HideParent(true);
                        })
            )

ToComponent()

Returns the internal view component.

Name(System.String)

Sets the name of the component.

Parameters

componentName - System.String

The name of the component.

Example


            @(Html.Kendo().Grid<OrderViewModel>()
               .Name("grid")
               .Columns(columns =>
               {
                   columns.Bound(p => p.OrderID).Filterable(false);
                   columns.Bound(p => p.Freight);  
               })
               .DataSource(dataSource => dataSource
                   .Ajax()
                   .PageSize(20)
                   .Read(read => read.Action("Orders_Read", "Grid"))
               )
            )

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)

Parameters

deferred - System.Boolean

ModelMetadata(System.Web.Mvc.ModelMetadata)

Uses the Metadata of the Model.

Parameters

modelMetadata - System.Web.Mvc.ModelMetadata

The metadata set for the Model

HtmlAttributes(System.Object)

Sets the HTML attributes.

Parameters

attributes - System.Object

The HTML attributes.

HtmlAttributes(System.Collections.Generic.IDictionary)

Parameters

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

AsChildComponent()

Render()

Renders the component.

Example


            @(@Page Inherits="System.Web.Mvc.ViewPage<IEnumerable<Product>>" )
            @( Html.Kendo().Grid(Model)
                .Name("grid")
                .DetailTemplate(product => {
                    )
                       Product Details:
                       <div>Product Name: @( product.ProductName )</div>
                       <div>Units In Stock: @( product.UnitsInStock )</div>
                    @(
                })
                .Render();
            )

ToHtmlString()

ToClientTemplate()

In this article
Not finding the help you need?