I'm copying a DataGrid to the clipboard so that it can be pasted to e.g. Excel while maintaining its format like this:
MyDataGrid.SelectAllCells();
MyDataGrid.ClipboardCopyMode = DataGridClipboardCopyMode.IncludeHeader;
ApplicationCommands.Copy.Execute(null, MyDataGrid);
This works very nice. However, I need to add the string "MyDataGridTitle". If pasted to Excel, this should simply stand above the DataGrid.
I have tried various ways (e.g. use a DataObject) and tortured google, but to no success. I'd be thankful for a hint, tip or answer!