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

Open ContextMenu in code-behind

2 Answers 626 Views
ContextMenu
This is a migrated thread and some comments may be shown as answers.
Eric
Top achievements
Rank 1
Eric asked on 20 May 2011, 10:35 AM
Hello,

I associated a contextmenu with a text box.. When "RightClick" on it, the contextmenu opens correctly as expected. I would like to open it in code-behind, let's say when user type CTRL+SPACE for instance or when the user clicks a button beside the textbox.

How to achieve this with radContextMenu?

Thanks in advance for your answer.
regards
--
Eric

2 Answers, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 20 May 2011, 01:36 PM
Hello Eric,

RadContextMenu have IsOpen property which you can set from code in order to open it.
Here is how:
var contextmenu = RadContextMenu.GetContextMenu(this.textBox1);
contextmenu.IsOpen = true;

Let us know if you need more information.

Kind regards,
Hristo
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Eric
Top achievements
Rank 1
answered on 20 May 2011, 02:05 PM
Hristo,

It works perfectly, thanks a lot.

regards
--
Eric
Tags
ContextMenu
Asked by
Eric
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Eric
Top achievements
Rank 1
Share this question
or