Edit this page

Getting Started

This article will show you how to create a simple PanelBar.

Getting Started with RadPanelBar

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

You can find more info here.

  1. Drag and Drop the PanelBar control from the toolbox.

  2. After you have dropped the control onto the XAML you can manage the control by setting various properties to operate the control's behavior:

        <telerik:RadPanelBar VerticalAlignment="Center" ExpandMode="Single" />
    

    Populating the RadPanelBar with Items

Declaratively populating the RadPanelBar control Items collection

You can add RadPanelBarItems directly to the RadPanelBar.Items collection in XAML:

<telerik:RadPanelBar>
    <telerik:RadPanelBarItem Header="Item 1" />
    <telerik:RadPanelBarItem Header="Item 2" />
    <telerik:RadPanelBarItem Header="Item 3" />
</telerik:RadPanelBar>

Or you can populate the items collection from code-behind:

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

The alternative to populating a RadPanelBar by explicitly declaring its items, is data binding the control to a collection of objects. Here is an example of binding a RadPanelBar to a list of strings:

List<string> myListDataSource = new List<string>();
myListDataSource.Add("Item 1");
myListDataSource.Add("Item 2");
myListDataSource.Add("Item 3");
RadPanelBar myPanel = new RadPanelBar();
myPanel.ItemsSource = myListDataSource;
Dim myListDataSource As New List(Of String)()
myListDataSource.Add("Item 1")
myListDataSource.Add("Item 2")
myListDataSource.Add("Item 3")
Dim myPanel As New RadPanelBar()
myPanel.ItemsSource = myListDataSource