Open ContextMenu in code-behind

3 posts, 0 answers
  1. Eric
    Eric avatar
    25 posts
    Member since:
    Dec 2009

    Posted 20 May 2011 Link to this post

    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. Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 20 May 2011 Link to this post

    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
  3. UI for WPF is Visual Studio 2017 Ready
  4. Eric
    Eric avatar
    25 posts
    Member since:
    Dec 2009

    Posted 20 May 2011 Link to this post

    Hristo,

    It works perfectly, thanks a lot.

    regards
    --
    Eric
Back to Top