Hi
I am using http://demos.telerik.com/aspnet-ajax/menu/examples/functionality/templates/defaultcs.aspx to generate menu
How can i use the bread crumb up to the level RadSiteMapNode. I was using following code sample but not working
using System;
using System.Collections.Generic;
using Telerik.Web.UI;
namespace Menu.Examples.Programming.ShowPath
{
public partial class DefaultCS : System.Web.UI.Page
{
//If RadMenu is data bound, please use its DataBound event instead of PageLoad.
protected void Page_Load(object sender, EventArgs e)
{
RadMenuItem currentItem = RadMenu1.FindItemByUrl(Request.Url.PathAndQuery);
if (currentItem != null)
{
//Select the current item and his parents
currentItem.HighlightPath();
//Update the title of the
PageTitleLiteral.Text = currentItem.Text;
//Populate the breadcrumb
DataBindBreadCrumbSiteMap(currentItem);
}
else
RadMenu1.Items[0].HighlightPath();
}
private void DataBindBreadCrumbSiteMap(RadMenuItem currentItem)
{
List<
RadMenuItem
> breadCrumbPath = new List<
RadMenuItem
>();
while (currentItem != null)
{
breadCrumbPath.Insert(0, currentItem);
currentItem = currentItem.Owner as RadMenuItem;
}
BreadCrumbSiteMap.DataSource = breadCrumbPath;
BreadCrumbSiteMap.DataBind();
}
}
}
<
telerik:RadMenu
RenderMode
=
"Lightweight"
runat
=
"server"
ID
=
"RadMenu1"
Skin
=
"Glow"
>
<
DefaultGroupSettings
Height
=
"270px"
/>
<
Items
>
<
telerik:RadMenuItem
Text
=
"Asia"
>
<
ContentTemplate
>
<
telerik:RadSiteMap
runat
=
"server"
ID
=
"RadSiteMap1"
Skin
=
"Glow"
CssClass
=
"itemContent asia"
>
<
DefaultLevelSettings
ListLayout-RepeatColumns
=
"3"
></
DefaultLevelSettings
>
<
Nodes
>
<
telerik:RadSiteMapNode
Text
=
"Afghanistan"
></
telerik:RadSiteMapNode
>
<
telerik:RadSiteMapNode
Text
=
"Bangladesh"
></
telerik:RadSiteMapNode
>
<
telerik:RadSiteMapNode
Text
=
"Cambodia"
></
telerik:RadSiteMapNode
>
<
telerik:RadSiteMapNode
Text
=
"China"
></
telerik:RadSiteMapNode
>
<
telerik:RadSiteMapNode
Text
=
"India"
></
telerik:RadSiteMapNode
>
<
telerik:RadSiteMapNode
Text
=
"Indonesia"
></
telerik:RadSiteMapNode
>
<
telerik:RadSiteMapNode
Text
=
"Iran"
></
telerik:RadSiteMapNode
>
<
telerik:RadSiteMapNode
Text
=
"Iraq"
></
telerik:RadSiteMapNode
>
<
telerik:RadSiteMapNode
Text
=
"Japan"
></
telerik:RadSiteMapNode
>
<
telerik:RadSiteMapNode
Text
=
"Maldives"
></
telerik:RadSiteMapNode
>
<
telerik:RadSiteMapNode
Text
=
"Philippines"
></
telerik:RadSiteMapNode
>
<
telerik:RadSiteMapNode
Text
=
"Saudi Arabia"
></
telerik:RadSiteMapNode
>
<
telerik:RadSiteMapNode
Text
=
"Thailand"
></
telerik:RadSiteMapNode
>
<
telerik:RadSiteMapNode
Text
=
"Yemen"
></
telerik:RadSiteMapNode
>
<
telerik:RadSiteMapNode
Text
=
"United Arab Emirates"
></
telerik:RadSiteMapNode
>
</
Nodes
>
</
telerik:RadSiteMap
>
</
ContentTemplate
>
</
telerik:RadMenuItem
>
</
Items
>
</
telerik:RadMenu
>