Apparently there is a ContextMenu (Cut/Copy/Paste) in the cells of xamdatapresenter. How can i turn it off but keep my custom ContextMenu i created for the grid itself? As an example, see the Feature Browser WPF->xamDataGrid->Data Binding and Interaction->Unbound Fields. When you select the text inside of a cell, you can then right click and you will see a contextMenu w/ Cut/Copy/Paste.
Also, why don't the doesn' Ctrl-X, C or V actually perform the cut copy or paste anyway. Can i remove just the inputGestureText from the menu since it doesn't work anyway?
I would like to simply disable the context menu altogether, hide it completely or something. substituting a different menu is a no-go here. Is there a way to make a context menu specifically for each UnboundField or for all the UnBoundFields? I could do that and just set its Visiblity to Hidden perhaps? But I haven't been able to figure out how to do this
This is not a viable solution for me. I don't want any context menu when i right-click any selected text of any unbound field. Your solution replaces the menu. But if I specify no menu items in the context menu, then right-clicking produces a sliver-like context menu with nothing in it-not a solution. Please see the attached pics and example solution (it is basically your example, but with no menu items). How do i simply not show any context menu here, since IG has supplied one for unbound fields etc? To be more specific, using the Feature Browser as I described above, you would need to select (highlight) some of the Product Name field's text and then right-click the text to see the CUT/Copy/Paste context menu.
Hello treehan,
I am just checking if you require any further assistance on the matter.
Sincerely,
Ekaterina
Developer Support Engineer
Infragistics
www.infragistics.com/support
Hello,
I have been looking into your issue and in order to declare your own MenuItems you can set the editor’s ContextMenu property. If you declare a keyless style it will apply the custom items to every Editor in your XamDataPresenter and therefore the default once would not be shown. In addition to that you can handle a click event to specify what action to be taken in case of the user clicks on the item. Notice that I have enabled the desired clipboard operations using the FieldLayoutSettings’s AllowClipboardOperations property .
<Grid>
<Grid.Resources>
<Style TargetType="{x:Type editors:XamTextEditor}">
<Setter Property="ContextMenu">
<Setter.Value>
<ContextMenu >
<MenuItem Name="Add" Header="Create User" Click="Add_Click"/>
<MenuItem Name="Edit" Header="Update User" Click="Add_Click1"/>
<MenuItem Name="Delete" Header="Delete User" Click="Add_Click2"/>
<MenuItem Name="Seperator" Header="____________" />
</ContextMenu>
</Setter.Value>
</Setter>
</Style>
</Grid.Resources>
<igDP:XamDataPresenter BindToSampleData="True" Name="pres" >
<igDP:XamDataPresenter.FieldLayoutSettings>
<igDP:FieldLayoutSettings AllowClipboardOperations="Copy, Paste" />
</igDP:XamDataPresenter.FieldLayoutSettings>
</igDP:XamDataPresenter>
</Grid>
Please let me know if you need further assistance regarding that matter.
Infragistics, Inc.