The Items collection of the RadToolBar object
exposes the the root items of a RadToolBar.
The child buttons of a dropdown or split
button
can be accessed using the Buttons collections of these items.
This example demonstrates the server-side creation of the three types of toolbar
items described above.
You can create a root RadToolBarButton by using the code below:
C#:
RadToolBarButton rootButton = new RadToolBarButton("Bold");
RadToolBar1.Items.Add(rootButton);
VB:
Dim rootButton as RadToolBarButton = new RadToolBarButton("Bold")
RadToolBar1.Items.Add(rootButton)
You can create a RadToolBarDropDown and add a checkable RadToolBarButtonto it by
using the code below:
C#:
RadToolBarDropDown dropDown = new RadToolBarDropDown("Align");
RadToolBar1.Items.Add(dropDown);
RadToolBarButton leftButton = new RadToolBarButton("Left", true, "AlignGroup");
dropDown.Buttons.Add(leftButton);
VB:
Dim dropDown as RadToolBarDropDown = new RadToolBarDropDown("Align")
RadToolBar1.Items.Add(dropDown)
Dim leftButton as RadToolBarButton = new RadToolBarButton("Left", true, "AlignGroup")
dropDown.Buttons.Add(leftButton)