Hi - I am trying to copy the data from a WPF grid and send it in an email. I was able to do so with the clipboard
DGConnectionInfo.SelectAllCells();
DGConnectionInfo.ClipboardCopyMode = DataGridClipboardCopyMode.IncludeHeader;
ApplicationCommands.Copy.Execute(null, this.DGConnectionInfo);
string clipboardData = Clipboard.GetData(DataFormats.Html).ToString();
DGConnectionInfo.UnselectAllCells();
Clipboard.Clear();
return clipboardData;
The grid has various colors defining the states. With the clipboard copy, i am loosing the formatting.
Are there any other ways to achieve the same ?
Thanks.