We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Details View Context Menu

I'm curious to know how to create a context menu for details view only.

3 Replies

BR Balamurugan Rajaraman Syncfusion Team August 17, 2017 08:45 AM

Hi Michael, 
 
Thanks for contacting Syncfusion support. 
 
We have checked your query “Context menu for DetailViewGrid only”. You can able to achieve this requirement by initialize the context menu for the DetailsViewGrid only as like the below provided code sample. 
 
public MainWindow() 
{ 
    InitializeComponent(); 
//à Here we initialize the context menu for details view only 
    this.FirstLevelNestedGrid1.RecordContextMenu = new ContextMenu() { Name = "RecordMenu" }; 
    Binding b = new Binding(); 
    b.Source = this.FirstLevelNestedGrid1.RecordContextMenu; 
    b.Path = new PropertyPath("DataContext"); 
    var menuitem = new MenuItem() { Header = "Copy", Command = new BaseCommand(OnCopyClicked) }; 
    menuitem.SetBinding(MenuItem.CommandParameterProperty, b); 
    this.FirstLevelNestedGrid1.RecordContextMenu.Items.Add(menuitem); 
} 
 
We have the created the sample based upon your requirement and attached that sample for your reference you can able to get it from the below link 
 
 
Please refer the below link for getting information about the Context menu 
 
Regards, 
Balamurugan R 



MG Michael Griffith August 18, 2017 12:35 PM

Thanks again.



BR Balamurugan Rajaraman Syncfusion Team August 20, 2017 11:18 PM

Hi Michael, 
 
Thanks for the update. 
 
Please let us know if you need any further assist on this. 
 
Regards, 
Balamurugan R 


Loader.
Live Chat Icon For mobile
Up arrow icon