Edit this page

ToolBarTray HowTo

This article demonstrates how to define and populate the RadToolBarTray component.

Object instantiation

The RadToolBarTray component is located in the Telerik.Windows.Controls namespace and can be created with the following code:

<telerik:RadToolBarTray />

using Telerik.Windows.Controls; 
RadToolBarTray toolBarTray = new RadToolBarTray();
Imports Telerik.Windows.Controls    
Dim toolBarTray As New RadToolBarTray()

Add Items

In order to add items in the toolbar tray you can use its Items collection.

    <telerik:RadToolBarTray>
        <telerik:RadToolBar Band="0" BandIndex="0">
            <TextBlock Margin="0,0,9,0" Text="Open:" />
            <Button>
                <Image Source="/Images/ToolBar/Open.png" />
            </Button>
        </telerik:RadToolBar>
    </telerik:RadToolBarTray>

using Telerik.Windows.Controls;

RadToolBarTray toolBarTray = new RadToolBarTray();
RadToolBar toolBar = new RadToolBar();
this.LayoutRoot.Children.Add(toolBarTray);
toolBarTray.Items.Add(toolBar);
Imports Telerik.Windows.Controls

Dim toolBarTray As New RadToolBarTray()
Dim toolBar As New RadToolBar()
Me.LayoutRoot.Children.Add(toolBarTray)
toolBarTray.Items.Add(toolBar)