You can create a hierarchical menu in the following ways:
- by defining the hierarchical structure inline;
- programmatically, by using the server-side API;
- by binding to a hierarchical data source control;
- by binding to a non-hierarchical data source with a DataFieldID / DataFieldParentID relation.
Define the hierarchy inline
You do not need to set any property of the menu to make it hierarchical. Simply arrange the items hierarchically when defining the menu through the ASPX.
A menu control has an Items property that represents its items. You can add items to this collection; any item from this collection can also have its own Items collection. Thus you build the hierarchy of items rendered by the menu.
Example
The example below illustrates a hierarchical menu with up to three levels for some items. The picture shows all three levels. The active items in the picture are shown bold in the ASPX code.

| ASPX |
Copy Code |
|
<rad:RadMenu id="RadMenu1" runat="server" Skin="Telerik"> <Items> <rad:RadMenuItem runat="server" Text="Corporate" SelectedIndex="0"> <Items> <rad:RadMenuItem runat="server" Text="About us"> <Items> <rad:RadMenuItem runat="server" Text="News"></rad:RadMenuItem> <rad:RadMenuItem runat="server" Text="Team"></rad:RadMenuItem> </Items> </rad:RadMenuItem> <rad:RadMenuItem runat="server" Text="Careers"></rad:RadMenuItem> </Items> </rad:RadMenuItem> <rad:RadMenuItem runat="server" Text="Services"> <Items> <rad:RadMenuItem runat="server" Text="Products"></rad:RadMenuItem> <rad:RadMenuItem runat="server" Text="Solutions"></rad:RadMenuItem> <rad:RadMenuItem runat="server" Text="Certifications"></rad:RadMenuItem> </Items> </rad:RadMenuItem> <rad:RadMenuItem runat="server" Text="Work"> <Items> <rad:RadMenuItem runat="server" Text="Clients"></rad:RadMenuItem> <rad:RadMenuItem runat="server" Text="Testimonials"></rad:RadMenuItem> <rad:RadMenuItem runat="server" Text="FAQ"></rad:RadMenuItem> </Items> </rad:RadMenuItem> </Items> </rad:RadMenu> |
Bind to a hierarchical data source
If bound to a hierarchical data source, the menu will appear multi-level. You do not need to set any additional properties.
To learn more, see SiteMapDataSource control.
Bind to a non-hierarchical data source with the DataFieldID/DataFieldParentID
See Hierarchical data binding and Data Bindings.
See Also