Controls in Context Menu

3 posts, 0 answers
  1. Sasmita
    Sasmita avatar
    19 posts
    Member since:
    Jul 2008

    Posted 01 Aug 2008 Link to this post

    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. Peter
    Admin
    Peter avatar
    1159 posts

    Posted 04 Aug 2008 Link to this post

    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.
  3. Sasmita
    Sasmita avatar
    19 posts
    Member since:
    Jul 2008

    Posted 04 Aug 2008 Link to this post

    Thank you so much.

    Sasmita
Back to Top