Dear Sir,
I am using sitemap file to fill up RadMenu, it has only top level Image menu, no any subMenu.
To display image I have written following code inside ItemDataBound.
protected void RadMenu1_ItemDataBound(object sender, Telerik.Web.UI.RadMenuEventArgs e)
{
SiteMapNode node = e.Item.DataItem as SiteMapNode;
e.Item.ImageUrl = node["CustomImageURL"];
e.Item.HoveredImageUrl = node["HoverImageURL"];
}
In above code I have written to display imageUrl and MouseHourImage.
Now I want selected menu should have different image therefore I need selected menu index or name.
RadMenu contain ItemClick event but this event will be execute at the time of sub menu clicked.
When I check “sender” object parameter in QuickWatch I found that following line return selected page url .
((Telerik.Web.UI.HierarchicalControlItemContainer)(sender)).CurrentSiteMapUrl
But when I try to write in code it gives me compilation error that “The property or indexer 'Telerik.Web.UI.HierarchicalControlItemContainer.CurrentSiteMapUrl' cannot be used in this context because the get accessor is inaccessible.”
I want to know that, is there any another way to display Selected image in RadMenu?