Data Binding
The PanelBar provides support for declaratively defining its items and for local (on the server) and remote (using a DataSource
configuration object) binding.
Declaring PanelBar Items
The PanelBar allows you to declare all its items within the helper declaration.
The following example demonstrates how to configure a PanelBar with three levels of hierarchy.
@(Html.Kendo().PanelBar()
.Name("panelbar")
.Items(panelbar =>
{
panelbar.Add().Text("My Web Site")
.Items(root =>
{
root.Add().Text("images")
.Items(images =>
{
images.Add().Text("logo.png");
images.Add().Text("body-back.png");
});
root.Add().Text("about.html");
root.Add().Text("contacts.html");
});
})
)
<kendo-panelbar name="panelbar">
<items>
<panelbar-item text="My Web Site">
<items>
<panelbar-item text="images">
<items>
<panelbar-item text="logo.png"></panelbar-item>
<panelbar-item text="body-back.png"></panelbar-item>
</items>
</panelbar-item>
<panelbar-item text="about.html"></panelbar-item>
<panelbar-item text="contacts.html"></panelbar-item>
</items>
</panelbar-item>
</items>
</kendo-panelbar>
PanelBar Binding
The PanelBar supports the following data-binding approaches: