For WPF, Data Grid I am trying to copy to clipboard my custom text data, after Ctrl+C
Diverse attempts to use override
OnCopyingRowClipboardContent(DataGridRowClipboardEventArgs args)
or CopingRowClipboardContent event
, don't help.
Either clipboard gets empty or standard row text, but not what I would like to put there. For instance
protected override void OnCopyingRowClipboardContent(DataGridRowClipboardEventArgs args)
{
Clipboard.SetText("Abc-hello");
bool b1 = Clipboard.ContainsText();
string s1 = Clipboard.GetText();
}
s1
gets desired text, but after going out of this method clipboard gets empty.
Any idea if one can solve this?