Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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
C#
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?
Posted

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900