populating separators dynamically in RadMenu - Front- & Back-End Development - Front- & Back-End Development - Progress Community
 Front- & Back-End Development

populating separators dynamically in RadMenu

  • populating separators dynamically in RadMenu
  • 3b270987-4cb5-6f77-96ac-ff0000ae3c70_menu1.png
    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 :)    
  • 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.