I am using a WPF DataGrid to display name-value pairs. SelectionUnit is set to FullRow because it looks nice, however, when user selects a row and presses Ctrl+C he really wants to copy the value text rather than the default behavior which is a concatenation of name and value. When looking for solution I found CopyingRowClipboardContent event but the MSDN page has no information about how to use it. Or should I capture PreviewKeyDown myself?
I am using a WPF DataGrid to display name-value pairs. SelectionUnit is set to
Share
You can modify the copied data in the
CopyingRowClipboardContentevent handler using theDataGridRowClipboardEventArgs.Decompiled source code
So for example, if you have two columns and you only want the first, you can remove the second item like this: