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

Controls in Context Menu

2 Answers 49 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sasmita
Top achievements
Rank 1
Sasmita asked on 01 Aug 2008, 04:26 PM
Hi ,
Is there a way where i can have controls on Context Menu. .

I have my requirement like, when user right clicks, the Context menu that Pops up should have a check box followed by some text . I can have  just text by the below code . But can i have controls on a context menu.

RadDropDownMenu
menu = new RadDropDownMenu();
RadMenuItem
item = new RadMenuItem("Context Menu");
menu.Items.Add(item);

Any kind of help is appreciated.

Thanks,
Sasmita

2 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 04 Aug 2008, 01:41 PM
Hello Sasmita,

Thank you for writing.

You can easily add custom check box items to RadMenu using the following code:

            RadMenuContentItem contentItem = new RadMenuContentItem(); 
            RadCheckBoxElement checkBox = new RadCheckBoxElement(); 
            checkBox.Text = "Some text"
            contentItem.MinSize = new Size(100,16); 
            contentItem.ContentElement = checkBox; 
            contextMenu.Items.Insert(0,contentItem); 


Please, take look at Telerik Quick-Start FraweWork (QSF) Section RadMenuStrip -> Menu Item with custom elements. There are many examples with custom menu elements.

I hope this helps.
Don't hesitate to contact us if you have other questions.

Kind regards,
Peter
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Sasmita
Top achievements
Rank 1
answered on 04 Aug 2008, 01:43 PM
Thank you so much.

Sasmita
Tags
General Discussions
Asked by
Sasmita
Top achievements
Rank 1
Answers by
Peter
Telerik team
Sasmita
Top achievements
Rank 1
Share this question
or