Change Order of Options in the ContextMenu

3 posts, 1 answers
  1. Tom Chien
    Tom Chien avatar
    125 posts
    Member since:
    Jun 2009

    Posted 24 Oct 2009 Link to this post

    I see examples for adding custom options to the bottom of the ContextMenu.  How do I add / move them to the top?  RadMenuItem doesn't have an Index Property for changing order like .Net's MenuItem does.

    2009Q2 (2009.2.9.729), VS 2005 (v8.0.50727.762 SP.050727-7600), .Net2 (2.0.50727), XP SP3, Core2Duo 2.99GHZ with 3GB.



  2. Answer
    Jack
    Admin
    Jack avatar
    2333 posts

    Posted 28 Oct 2009 Link to this post

    Hello Tom,

    Just use the Insert method when adding a custom item. Here is a sample:

    void radGridView1_ContextMenuOpening(object sender, ContextMenuOpeningEventArgs e)
    {
        e.ContextMenu.Items.Insert(2, new RadMenuItem("Custom item 1"));
    }

    I hope this helps. If you need further assistance, I will be glad to help.

    Kind regards,
    Jack
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Tom Chien
    Tom Chien avatar
    125 posts
    Member since:
    Jun 2009

    Posted 29 Oct 2009 Link to this post

    Thank you!
Back to Top