+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / populating separators dynamically in RadMenu

populating separators dynamically in RadMenu

2 posts, 0 answered
  1. varun
    varun avatar
    1 posts
    Registered:
    27 May 2013
    27 May 2013
    Link to this post
    i am using a radmenu where i poulate the items dynamically from sqldata source.
    i have only the radmenu declaration in aspx file and the rest in code behind.
    now i need to implement separators for this menu items.
     how can it be done dynamically using sql data source ??
    thanks in advance :)    
  2. Kate
    Kate avatar
    1 posts
    Registered:
    24 Sep 2012
    30 May 2013
    Link to this post
    Hello Varun,

    One approach that you can use is to set a specific value for the MenuItem (which you intend to use as separator) and on ItemDataBound event to check this value and set the IsSeparator property of the item to true as below:

    protected void RadMenu1_ItemDataBound(object sender, RadMenuEventArgs e)
        {
            if (e.Item.Value == "someValue")
            {             
                e.Item.IsSeparator = true;
            }
        }

    You can also bind the value by using the DataValueField property of the RadMenu.  

    Regards,
    Kate
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
2 posts, 0 answered