# PanelBarBuilder

## Properties

### WriteAction - Func

## Methods

### Items(System.Action)

Defines the items within the PanelBar declaration.

#### Parameters

##### addAction - System.Action<[PanelBarItemFactory](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/panelbaritemfactory)>

The add action.

#### RETURNS

Returns the current [PanelBarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/panelbarbuilder) instance.

#### Example

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

### DataSource(System.Action)

Configures the DataSource of the component for remote data binding.

#### Parameters

##### configurator - System.Action<[HierarchicalDataSourceBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/hierarchicaldatasourcebuilder)>

The action that configures the DataSource of the component.

#### RETURNS

Returns the current [PanelBarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/panelbarbuilder) instance.

#### Example

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

### DataSource(System.String)

Specifies the ID of an existing DataSource component that will be used for data binding.

#### Parameters

##### dataSourceId - `System.String`

The name of the DataSource.

#### RETURNS

Returns the current [PanelBarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/panelbarbuilder) instance.

#### Example

```
 
             @(Html.Kendo().PanelBar()
                .Name("PanelBar")
                .DataSource("dataSource1")
             )
             @(Html.Kendo().DataSource<Product>()
                .Name("dataSource1")
                .Ajax(dataSource => dataSource
                    .Read(read => read.Action("Products_Read", "Home"))
                    .PageSize(20)
                )
             )
             
```

### BindTo(System.Collections.Generic.IEnumerable)

Binds the PanelBar to local data. To bind the PanelBar declaratively, use the Items() method.

#### Parameters

##### items - System.Collections.Generic.IEnumerable<[PanelBarItemModel](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui/panelbaritemmodel)>

The IEnumerable of PanelBarItemModel items.

#### RETURNS

Returns the current [PanelBarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/panelbarbuilder) instance.

#### Example

```
 
             @( Html.Kendo().PanelBar()
                .Name("PanelBar")
                .BindTo((IEnumerable<PanelBarItemModel>)ViewBag.panelbarData)
              )
             
```

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

Binds the PanelBar to a list of objects and map the Model properties to the PanelBarItem properties.

#### Parameters

##### dataSource - `System.Collections.IEnumerable`

The IEnumerable collection of Model.

##### factoryAction - System.Action<[NavigationBindingFactory](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/navigationbindingfactory)>

The action which will configure the mappings.

#### RETURNS

Returns the current [PanelBarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/panelbarbuilder) instance.

#### Example

```
 
             @(Html.Kendo().PanelBar()
                        .Name("PanelBar")
                        .BindTo((IEnumerable<Customer>)ViewBag.inline, (NavigationBindingFactory<PanelBarItem> mappings) =>
                        {
                            mappings.For<Customer>(binding => binding.ItemDataBound((item, customer) => // Map "Customer" properties to PanelBarItem properties
                            {
                                item.Text = customer.ContactName;
                             }).Children(c => c.Orders)); // The "child" items will be bound to the "Orders" property
                            mappings.For<Order>(binding => binding.ItemDataBound((item, order) => // Map "Order" properties to PanelBarItem properties
                            {
                                item.Text = order.OrderName;
                             }));
                        })
             )
             
```

### 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](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui/panelbaritem),T>

The action executed for every data bound item.

#### RETURNS

Returns the current [PanelBarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/panelbarbuilder) instance.

#### Example

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

### Animation(System.Boolean)

Configures the visual animations of the PanelBar.

#### Parameters

##### enable - `System.Boolean`

The boolean value.

#### RETURNS

Returns the current [PanelBarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/panelbarbuilder) instance.

#### Example

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

### Animation(System.Action)

Configures the visual animations of the PanelBar.

#### Parameters

##### animationAction - System.Action<[ExpandableAnimationBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/expandableanimationbuilder)>

The action that configures the animations.

#### RETURNS

Returns the current [PanelBarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/panelbarbuilder) instance.

#### 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](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui/panelbaritem)>

Action, which will be executed for each item.

#### RETURNS

Returns the current [PanelBarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/panelbarbuilder) instance.

#### 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.

#### RETURNS

Returns the current [PanelBarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/panelbarbuilder) instance.

#### Example

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

### ExpandAll(System.Boolean)

Renders the PanelBar with expanded items.

#### Parameters

##### value - `System.Boolean`

The boolean value.

#### RETURNS

Returns the current [PanelBarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/panelbarbuilder) instance.

#### Example

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

### SelectedIndex(System.Int32)

Selects the item at the specified index.

#### Parameters

##### index - `System.Int32`

The index.

#### RETURNS

Returns the current [PanelBarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/panelbarbuilder) instance.

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

#### RETURNS

Returns the current [PanelBarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/panelbarbuilder) instance.

#### Example

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

### DataIconField(System.String)

Sets the field of the data item that provides the icon name of the PanelBar nodes.

#### Parameters

##### value - `System.String`

The value for DataIconField

#### RETURNS

Returns the current [PanelBarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/panelbarbuilder) instance.

#### Example

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

### DataIconClassField(System.String)

Sets the field of the data item that provides the custom class for the icon element of the PanelBar nodes.

#### Parameters

##### value - `System.String`

The value for DataIconClassField

#### RETURNS

Returns the current [PanelBarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/panelbarbuilder) instance.

#### Example

```
 
            @( Html.Kendo().PanelBar()
                        .Name("PanelBar")
                        .Items(items =>
                        {
                            items.Add().Text("First Item");
                            items.Add().Text("Second Item");
                        })
                        .DataIconClassField("k-i-pencil")
            )
             
```

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

#### RETURNS

Returns the current [PanelBarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/panelbarbuilder) instance.

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

#### RETURNS

Returns the current [PanelBarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/panelbarbuilder) instance.

#### Example

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

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

#### RETURNS

Returns the current [PanelBarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/panelbarbuilder) instance.

#### Example

```
 
            @(Html.Kendo().PanelBar()
                .Name("PanelBar")
                .DataTextField("Name")
                .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 nodes.

#### Parameters

##### value - `System.String`

The value for DataUrlField

#### RETURNS

Returns the current [PanelBarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/panelbarbuilder) instance.

#### Example

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

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

#### RETURNS

Returns the current [PanelBarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/panelbarbuilder) instance.

#### Example

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

### Messages(System.Action)

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

#### Parameters

##### configurator - System.Action<[PanelBarMessagesSettingsBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/panelbarmessagessettingsbuilder)>

The configurator for the messages setting.

#### RETURNS

Returns the current instance of [PanelBarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/panelbarbuilder) .

### Template(System.String)

Template for rendering each node.

#### Parameters

##### value - `System.String`

The value for Template

#### RETURNS

Returns the current [PanelBarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/panelbarbuilder) instance.

#### Example

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

### TemplateId(System.String)

Template for rendering each node.

#### Parameters

##### templateId - `System.String`

The ID of the template element for Template

#### RETURNS

Returns the current [PanelBarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/panelbarbuilder) instance.

#### Example

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

### TemplateView(Microsoft.AspNetCore.Html.IHtmlContent)

Template for rendering each node.

#### Parameters

##### templateView - `Microsoft.AspNetCore.Html.IHtmlContent`

The view that contains the template for Template

#### RETURNS

Returns the current [PanelBarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/panelbarbuilder) instance.

#### Example

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

### TemplateHandler(System.String)

Template for rendering each node.

#### Parameters

##### templateHandler - `System.String`

The handler that returs the template for Template

#### RETURNS

Returns the current [PanelBarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/panelbarbuilder) instance.

#### Example

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

### Template(Kendo.Mvc.UI.Fluent.TemplateBuilder)

Template for rendering each node.

#### Parameters

##### template - TemplateBuilder\<TModel>

A Template component that configures the template.

#### RETURNS

Returns the current [PanelBarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/panelbarbuilder) instance.

### ExpandMode(Kendo.Mvc.UI.PanelBarExpandMode)

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

#### Parameters

##### value - [PanelBarExpandMode](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui/panelbarexpandmode)

The value for ExpandMode

#### RETURNS

Returns the current [PanelBarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/panelbarbuilder) instance.

#### Example

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

### Events(System.Action)

Configures the client-side events.

#### Parameters

##### configurator - System.Action<[PanelBarEventBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/panelbareventbuilder)>

The client events action.

#### RETURNS

Returns the current [PanelBarBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/panelbarbuilder) instance.

#### Example

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

### ToComponent()

Returns the internal view component.

#### RETURNS

The  instance that represents the component.

### Expression(System.String)

Sets the name of the component.

#### Parameters

##### modelExpression - `System.String`

The name.

#### RETURNS

Returns the current  instance.

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

Sets the name of the component.

#### Parameters

##### modelExplorer - `Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer`

The name.

#### RETURNS

Returns the current  instance.

### Name(System.String)

Sets the name of the component.

#### Parameters

##### componentName - `System.String`

The name.

#### RETURNS

Returns the current  instance.

### 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,System.Boolean)

#### Parameters

##### deferred - `System.Boolean`

#### RETURNS

Returns a [DeferredWidgetBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/deferredwidgetbuilder) instance.

### HtmlAttributes(System.Object)

Sets the HTML attributes.

#### Parameters

##### attributes - `System.Object`

The HTML attributes.

#### RETURNS

Returns the current  instance.

### HtmlAttributes(System.Collections.Generic.IDictionary)

Sets the HTML attributes.

#### Parameters

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

The HTML attributes.

#### RETURNS

Returns the current  instance.

### ScriptAttributes(System.Object,System.Boolean)

Sets the JavaScript attributes to the initialization script.

#### Parameters

##### attributes - `System.Object`

The JavaScript attributes.

##### overrideAttributes - `System.Boolean`

Argument which determines whether attributes should be overriden.

#### RETURNS

Returns the current  instance.

### ScriptAttributes(System.Collections.Generic.IDictionary,System.Boolean)

Sets the JavaScript attributes to the initialization script.

#### Parameters

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

The JavaScript attributes.

##### overrideAttributes - `System.Boolean`

Argument which determines whether attributes should be overriden.

#### RETURNS

Returns the current  instance.

### Render()

Renders the component in place.

### ToHtmlString()

Returns the HTML representation of the component.

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

#### Parameters

##### writer - `System.IO.TextWriter`

##### encoder - `System.Text.Encodings.Web.HtmlEncoder`

### ToClientTemplate()

Returns the client template for the component.

### AsModule(System.Boolean)

Specifies whether the initialization script of the component will be rendered as a JavaScript module.

#### Parameters

##### value - `System.Boolean`

#### RETURNS

Returns the current  instance.
