Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

WPF Grid copy with colors and lines

$
0
0

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.


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>