Hello Paul,
The GetPages(PageLanguage) method returns an object that represents hierarchical structure of the pages.
See the BuildMenu(DesignerPageCollection pages) method in the RadMenuControl.ascx:
private void BuildMenu(DesignerPageCollection pages)
{
foreach (IDesignerPage page in pages.RootPage.Pages)
{
if (!page.IsNavigable)
{
continue;
}
Telerik.WebControls.RadMenuItem item = new Telerik.WebControls.RadMenuItem();
menu1.Items.Add(item);
if (page.Id == this._pageId)
{
item.CssClass = this.selectedItemCssClass;
}
if (page.Details.Alias == string.Empty)
{
item.Text = page.Details.Name;
}
else
{
item.Text = page.Details.Alias;
}
item.NavigateUrl = Helper.GetPageUrl(page.Details.Name, page.Guid);
LoadMenuItemsRecursive(page, item, page.Details.Name);
}
}
Calling pages.RootPage.Pages will return only the root level pages and Pages property of each instance IDesignerPage object will return only its child pages.
Also have a look at the implementation of RadPanelbarControl.ascx. It has two properties: RootLevel and NestingLevels. Set the RootLevel property to the index of the root level pages to display, the defauld is 0 that means the highest level. Set NestingLevels property to the number of nesting levels to expand the panelbar, the default is 1. The same logic could be implemented with the menu as well.
Please let us know if you need more help.
Greetings,
Vlad
the
telerik team