PanelBarBuilder
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");
})
)
AutoBind(System.Boolean)
Controls whether to bind the widget to the DataSource on initialization.
Parameters
autoBind - System.Boolean
Example
@( Html.Kendo().PanelBar()
.Name("PanelBar")
.AutoBind(false)
)
Template(System.String)
Template to be used for rendering the items in the panelbar.
Parameters
template - System.String
Example
@( Html.Kendo().PanelBar()
.Name("PanelBar")
.Template("#= data #")
)
TemplateId(System.String)
Id of the template element to be used for rendering the items in the panelbar.
Parameters
templateId - System.String
Example
@( Html.Kendo().PanelBar()
.Name("PanelBar")
.TemplateId("widgetTemplateId")
)
TemplateView(System.Web.Mvc.MvcHtmlString)
View template to be used for rendering the items in the panelbar.
Parameters
template - System.Web.Mvc.MvcHtmlString
Example
@( Html.Kendo().PanelBar()
.Name("PanelBar")
.TemplateView(Html.Partial("panelbar-template"))
)
TemplateHandler(System.String)
Parameters
template - System.String
Events(System.Action)
Configures the client-side events.
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)
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.Generic.IEnumerable,System.Action)
Binds the panelbar to a list of objects
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)
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
)
)
)
DataSource(System.Action)
Configure the DataSource of the component
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)
Allows the panelbar to fetch the entire datasource at initialization time.
Parameters
value - System.Boolean
Whether the datasource should be loaded on demand.
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 nodes.
Parameters
value - System.String
The value that configures the 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 that configures the dataspritecssclassfield.
DataUrlField(System.String)
Sets the field of the data item that provides the link URL of the nodes.
Parameters
value - System.String
The value that configures the dataurlfield.
Messages(System.Action)
The text messages displayed in the widget. Use it to customize or localize the messages.
Parameters
configurator - System.Action<PanelBarMessagesSettingsBuilder>
The action that configures the messages.
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 that configures the datatextfield.
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>
Action, which will be executed for each item.
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)
)
ExpandMode(Kendo.Mvc.UI.PanelBarExpandMode)
Sets the expand mode of the panelbar.
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)
Enable/disable security trimming functionality of the component.
Parameters
value - System.Boolean
If true security trimming is enabled.
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();
)