Hi,
I have 2 data grids and have a situation where a user can right click on a column that brings up a menu item that allows the user to "Sent to other grid column" option where the selected column values need to be copied across to the same column on the other grid,
If there is a way to get the Key, i can then get the values and copy it into the same Property on the observable collection of the other grid.
So how do i get the Key that the grid is bound to ? I want to do this in the MVVM way, is there a way out?
Hello,
I am just checking if you require any further assistance on the matter.
I have been looking into your question and the easiest way to access the ‘Key’ of a column is :
this.MyGrid.ActiveCell.Column.Key;
If you are looking for a MVVM approach you can look through the following forum thread :
https://ko.infragistics.com/community/forums/f/ultimate-ui-for-wpf/69928/wpf-mvvm-xamgrid-selection-event
If you have any other questions on this matter, feel free to ask.
I have attached the menu items this way using xaml, so how do i get the actual column key thats been clicked on?
<ig:ContextMenuService.Manager> <!--If you use the Infragistics Commanding Framework, you should set the OpenMode property to None--> <ig:ContextMenuManager ModifierKeys="None" OpenMode="RightClick"> <ig:ContextMenuManager.ContextMenu> <ig:XamContextMenu HorizontalAlignment="Left" Name="xamContextMenu1" VerticalAlignment="Top"> <ig:XamMenuItem Header="dfgdfg" /> <ig:XamMenuItem Header="dhdhdfj" /> <ig:XamMenuItem Header="ftuigym" /> </ig:XamContextMenu> </ig:ContextMenuManager.ContextMenu> </ig:ContextMenuManager> </ig:ContextMenuService.Manager>
can somebody suggest some ideas please?