Show context menu

4 posts, 0 answers
  1. ruty
    ruty avatar
    42 posts
    Member since:
    Mar 2009

    Posted 31 Mar 2009 Link to this post

    Hi,

     

    I'm implementing a right click in my application with Windowless,

     

     

    and I want that when the implementation will happen, a context menu will be shown, without giving it an eventName.
    I want that the context menu show in my implementing a right click in my application .
    Thanks

  2. Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 01 Apr 2009 Link to this post

    Hello ruty,

    If you want manually to open RadContextMenu just set the EventName="" property to empty string.
    The to open the context menu use IsOpen=true property.

    Let us know if you need more help.

    Sincerely yours,
    Hristo
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  3. ruty
    ruty avatar
    42 posts
    Member since:
    Mar 2009

    Posted 01 Apr 2009 Link to this post

    Thank, 
    I do it, but  get error:"Object reference not set to an instance of an object."
    my code:
     RadContextMenu buttonContextMenu = new RadContextMenu();  
                            
                            buttonContextMenu.ShowDelay =new Duration (new TimeSpan (1,0,0));  
                            buttonContextMenu.EventName = " ";  
                            RadMenuItem item1 = new RadMenuItem()  
                            {  
                                Header = "Statuses" 
                            };  
     
                            RadMenuItem item11 = new RadMenuItem()  
                            {  
                                Header = "Open" 
                            };  
                            item1.Items.Add(item11);  
                              
                            RadMenuItem item12 = new RadMenuItem()  
                            {  
                                Header = "New" 
                            };  
                            item1.Items.Add(item12);  
                            RadMenuItem item13 = new RadMenuItem()  
                            {  
                                Header = "Cancelled" 
                            };  
                            item1.Items.Add(item13);  
                            buttonContextMenu.Items.Add(item1);  
                            buttonContextMenu.IsOpen = true;  
                            RadContextMenu.SetContextMenu(taskElement, buttonContextMenu); 
    Thanks.
  4. Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 01 Apr 2009 Link to this post

    Hello ruty,

    You should set EventName to empty string (not space, just "") or null.
    And before setting IsOpen=true you should attach the menu to some element.
    (switch the last 2 rows).

    Let us know if you need more help.

    All the best,
    Hristo
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Back to Top