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

Show context menu

3 Answers 81 Views
Menu
This is a migrated thread and some comments may be shown as answers.
ruty
Top achievements
Rank 1
ruty asked on 31 Mar 2009, 10:47 AM
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

3 Answers, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 01 Apr 2009, 07:13 AM
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.
0
ruty
Top achievements
Rank 1
answered on 01 Apr 2009, 07:56 AM
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.
0
Hristo
Telerik team
answered on 01 Apr 2009, 02:51 PM
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.
Tags
Menu
Asked by
ruty
Top achievements
Rank 1
Answers by
Hristo
Telerik team
ruty
Top achievements
Rank 1
Share this question
or