Getting Started
This tutorial will walk you through the creation of a sample application that contains RadPanelBar.
- Assembly References
- Adding RadPanelBar to the Project
- Declaratively populating the RadPanelBar control Items collection
- Databinding the RadPanelBar control
Assembly References
In order to use RadPanelBar control in your projects you have to add references to the following assemblies:
- Telerik.Windows.Controls
- Telerik.Windows.Controls.Navigation
- Telerik.Windows.Data
Adding RadPanelBar to the Project
Example 1 demonstrates how you can add a RadPanelBar in xaml.
Example 1: RadPanelBar with statically declared items in xaml
<telerik:RadPanelBar>
<telerik:RadPanelBarItem Header="Item 1" />
<telerik:RadPanelBarItem Header="Item 2" />
<telerik:RadPanelBarItem Header="Item 3" />
</telerik:RadPanelBar>
Figure 1: Result from Example 1 in Office2016 Theme
Declaratively Populating the Items Collection of the RadPanelBar Control
Example 2 demonstrates how you can add RadPanelBarItems directly to the Items collection of the RadPanelBar in code behind:
Example 2: Adding RadPanelBarItems in code
RadPanelBar myPanelBar = new RadPanelBar();
RadPanelBarItem item1 = new RadPanelBarItem() { Header = "Item 1" };
RadPanelBarItem item2 = new RadPanelBarItem() { Header = "Item 2" };
RadPanelBarItem item3 = new RadPanelBarItem() { Header = "Item 3" };
myPanelBar.Items.Add(item1);
myPanelBar.Items.Add(item2);
myPanelBar.Items.Add(item3);
Dim myPanelBar As New RadPanelBar()
Dim item1 As New RadPanelBarItem() With {
.Header = "Item 1"
}
Dim item2 As New RadPanelBarItem() With {
.Header = "Item 2"
}
Dim item3 As New RadPanelBarItem() With {
.Header = "Item 3"
}
myPanelBar.Items.Add(item1)
myPanelBar.Items.Add(item2)
myPanelBar.Items.Add(item3)
Databinding the RadPanelBar Control
RadPanelBar can be also be bound to a collection of objects. You can learn more about this in the Bind to Object Data article in our documentation.