This is a migrated thread and some comments may be shown as answers.

RadMenu SiteMap ItemSeparator

1 Answer 164 Views
Sharepoint Integration
This is a migrated thread and some comments may be shown as answers.
vaibhav
Top achievements
Rank 1
vaibhav asked on 19 Oct 2010, 03:08 PM
I have a radmenu populated from a sharepoint 2010 sitemap. I want to have a separator after each menu item.
Have tried the following post http://www.sitefinity.com/devnet/forums/sitefinity-3-x/designing-with-sitefinity/how-to-add-separator-in-sitemenu-when-generating-it-from-sitemapdatasource.aspx but it doesnt work . Maybe the post is not specific to SharePoint and SiteMap. Is there any way to add seperator after each menu item in th code behind if the items are read from SharePoint default sitemap?

Please advise


1 Answer, 1 is accepted

Sort by
0
Kalina
Telerik team
answered on 01 Nov 2010, 11:53 AM
Hello vaibhav,

Let me suggest you populate the RadMenu via ASP.NET SiteMap that uses SPSiteMapProvider:
<asp:SiteMapDataSource
       SiteMapProvider="SPSiteMapProvider"
       ShowStartingNode="true"
       ID="SiteMap" runat="server" />
 
   <telerik:RadMenu runat="server" ID="RadMenu1"
   DataSourceID="SiteMap"
   OnItemDataBound="OnDataBoundHandler">
   </telerik:RadMenu>

Then you can add separator items handling the OnItemDatabound event in this manner:
protected void OnDataBoundHandler(object sender, RadMenuEventArgs e)
{
    RadMenuItem separator = new RadMenuItem();
    separator.IsSeparator = true;
    e.Item.Owner.Items.Insert(e.Item.Index + 1, separator);
}

Best wishes,
Kalina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Sharepoint Integration
Asked by
vaibhav
Top achievements
Rank 1
Answers by
Kalina
Telerik team
Share this question
or