populating separators dynamically in RadMenu

Posted by Community Admin on 04-Aug-2018 05:31

populating separators dynamically in RadMenu

All Replies

Posted by Community Admin on 27-May-2013 00:00

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 :)    

Posted by Community Admin on 30-May-2013 00:00

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.

This thread is closed