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

Change Order of Options in the ContextMenu

2 Answers 47 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Tom Chien
Top achievements
Rank 1
Tom Chien asked on 24 Oct 2009, 11:01 AM
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 Answers, 1 is accepted

Sort by
0
Accepted
Jack
Telerik team
answered on 28 Oct 2009, 10:28 AM
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.
0
Tom Chien
Top achievements
Rank 1
answered on 29 Oct 2009, 08:05 PM
Thank you!
Tags
GridView
Asked by
Tom Chien
Top achievements
Rank 1
Answers by
Jack
Telerik team
Tom Chien
Top achievements
Rank 1
Share this question
or