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

Problem with RadContextMenu.SetContextMenu

1 Answer 147 Views
ContextMenu
This is a migrated thread and some comments may be shown as answers.
Qutfullo
Top achievements
Rank 1
Qutfullo asked on 24 Nov 2015, 05:53 AM

Hello! 

I have a question about the RadContextMenu. I created my class DataGridView so this class inherited from RadGridView. If I add contextMenu with    RadContextMenu.SetContextMenu(this, contextMenu) can't add new contextMenu. Look this:

public class DataGridView : RadGridView
{

   public DataGridView()
   {

          // create menu
            var contextMenu = new RadContextMenu();
            RadMenuItem item = new RadMenuItem();
            item.Header = "Hello";
            contextMenu.Items.Add(item);
            contextMenu.Opened += ContextMenu_Opened;
            //add something that we can use to get the data grid on context menu events
            contextMenu.ItemClick += ContextMenu_ItemClick;
            contextMenu.Opening += ContextMenu_Opening;
            // set menu Theme
            StyleManager.SetTheme(contextMenu, StyleManager.GetTheme(this));
            RadContextMenu.SetContextMenu(this, contextMenu);

   }
           

}

1 Answer, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 24 Nov 2015, 02:59 PM
Hello Qutfullo,

We are not exactly sure that we completely understand your scenario. We tested the provided code-snippet and it seems everything works as expected on our side - the ContextMenu is set  as expected. Please, check the attached sample that demonstrates that. Could you please try to modify the sample in order to reproduce your issue and send it back to us - thus we could provide you with a prompt solution?

We also suggest you the following article from our help documentation that provides detailed information how to set RadContextMenu to RadGridView:
http://docs.telerik.com/devtools/wpf/controls/radcontextmenu/how-to/use-radcontextmenu-with-radgridview

We hope this will help you.

Regards,
Nasko
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
ContextMenu
Asked by
Qutfullo
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Share this question
or