Hi there,
I was wondering whether I could implement a menu item such as Copy,Paste and Cut when I click the right click of the mouse. I already implement the gesture of ctrl + c (copy) and ctrl + v (paste). Now i would like to right click mouse button to have the Menu item to appear in the xamDataGrid.
Regards,
snuffykl
Found my requirements. Using context menu. Great forum.
@Snuffykl: With respect to the code below, the shortcut keys work (e.g. CTRL+C), but the Copymenu is always disabled. I would have thought that XamGrid supported ApplicationCommands.Copy. Did you manage to get it to the Copy command to work in your code?
<ig:XamGrid x:Name="SampleGrid">
<ig:XamGrid.ClipboardSettings>
<ig:ClipboardSettings AllowCopy="True" CopyType="SelectedRows" CopyOptions="IncludeHeaders" AllowPaste="False" />
</ig:XamGrid.ClipboardSettings>
...
<ig:XamGrid.ContextMenu> <ContextMenu> <MenuItem Command="ApplicationCommands.Copy" /> <!-- this menu item is always disabled -->
</ig:XamGrid.ContextMenu> </ig:XamGrid> </UserControl>
ADDITIONAL CONTEXT
Hello,
You can suggest new product idea for future versions (or vote for existing ones) at http://ideas.infragistics.com.
There are many benefits to submitting an product idea:
- Direct communication with our product management team regarding your product idea.
- Notifications whenever new information regarding your idea becomes available.
- Ability to vote on your favorite product ideas to let us know which ones are the most important to you. You will have ten votes for this and can change which ideas you are voting for at any time.
- Allow you to shape the future of our products by requesting new controls and products altogether.
- You and other developers can discuss existing product ideas with members of our Product Management team.
Steps to create your idea:
The Product Idea site puts you in the driver’s seat and allows you to track the progress of your ideas at any time, see how many votes it got, read comments from other developers in the community, and see if someone from the product team has additional questions for you.
If you have a product back log...
Hi Stefan.
Thank you for your response.
After researching various options, I implemented the solution you proposed.
Thank you for your post. I have been looking into it and I can say that the command you use (ApplicationCommands.Copy) is the build-in MS command for copying text. The one that is used when you set the XamGrid ClipboardSetting is another one, which is not public, but there is a method in the XamGrid's class called CopyToClipBoard, which you can use in your own command. You only need to pass the XamGrid as parameter to the Execute method of the command and call CopyToClipBoard method.
Hope this helps you.