How to add a ContextMenu depending on which WPF DataGrid row is right-clicked? -


I need to display various options in a context menu, on which the right-click row of WPF DataGrid has gone. My initial idea was to complete it through handling the binding or mouse click event, but I have not had success with the strategy till now.

You can control the context of the data grid menuuping and based on the original source of the root event that your contact menus have been able to adjust.

Below is a sample where I show the context menu if the reference of the data is the source list of the source source otherwise I do not show context menu by handling the event.

  Private sub inventoryDragrid tagging menuUninstalling (_Wired as the Word sender object, in the form of a Word e system.windows.contactcontent.menuvent.org) handles_inventureDataGrid. Contains menu Opening diamond contact = DirectCast (E.Orizal Source, System.info Framework Element). Data Context If the reference to typeoff is an inventory, Inventory Data Grid. Context Menu = Inventory Data Grid.Resosource ("DefaultContact Menu") Other E. Handleld = True 'Don Context Menu Show end if end sub  

I'm sure it's too late to help you now Land, but if it is not too late and someone else comes in.


Comments