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

Separator on Menu

4 Answers 401 Views
Menu
This is a migrated thread and some comments may be shown as answers.
William
Top achievements
Rank 1
William asked on 22 Dec 2008, 04:02 AM
I'm using a RadMenu and I have added two Separators.  How can I give them some type of visual appearance?  The separators added a small amount of additional space beween menu items but does not give any type of visual.  Do I need to add an image? What I would like to have is something close to "|" display.

4 Answers, 1 is accepted

Sort by
0
John
Top achievements
Rank 1
answered on 22 Dec 2008, 05:22 AM
William,
    The Separators provide a visual bar for the horizontal menus by default so I am guessing you are doing this within the top level menu.  So a Separator added to the top level menu will add the spacing between menu items that you mentioned seeing.  One alternative to accomplish what you described with the "|" visual, you would need to use a RadMenuItem with an image then set the Enabled property to False so the user cannot click the menu entry. 

Hope this helps,
John
0
Deyan
Telerik team
answered on 22 Dec 2008, 05:06 PM
Hi John,

Thank you for your question.

To add a visual appearance of the separator you should only set the ShouldPaint property to "true". This will make the separator visible and you will be able to customize its appearance.

Do not hesitate to write back if you have further questions.

Sincerely yours,
Deyan
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Kevin
Top achievements
Rank 1
answered on 26 Jul 2012, 07:02 AM
Hi,

My menu items are table driven, i.e. one item per record. How do I add seperators to group them into logical groups?
0
Ivan Todorov
Telerik team
answered on 30 Jul 2012, 10:59 AM
Hello Kevin,

Thank you for writing.

Your account indicates that you are using only our ASP.NET AJAX tools. Please note that this section of the forum concerns the WinForms version of RadMenu. In case you questions is about the ASP.NET AJAX version, please post in the corresponding forum section.

In case your question concerns the WinForms version, you can simply add a RadMenuSeparatorItem to your menu items:
RadMenuItem myMenuItem = new RadMenuItem("My Items");
this.radMenu1.Items.Add(myMenuItem);
 
foreach (var group in myGroups)
{
    foreach (var item in group.Items)
    {
        myMenuItem.Items.Add(new RadMenuItem(item.ToString()));
    }
 
    myMenuItem.Items.Add(new RadMenuSeparatorItem());
}

Hope this helps. Do not hesitate to contact us if you have further questions.

Greetings,
Ivan Todorov
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
Tags
Menu
Asked by
William
Top achievements
Rank 1
Answers by
John
Top achievements
Rank 1
Deyan
Telerik team
Kevin
Top achievements
Rank 1
Ivan Todorov
Telerik team
Share this question
or