Home Forums WinForms controls Xceed Grid for WinForms Exporting data from Xceed Grid Reply To: Exporting data from Xceed Grid

User (Old forums)
Post count: 23064

To copy grid data to the clipboard in a format that Excel and Word recognize, you might consider using HTML.

1. Constructing the HTML-string:

StringBuilder str = new StringBuilder();
str.Append(“<table>”); // begin table
// pseudocode
for each row you want to add
str.Append(“<tr>”); // begin row
for each cell you want to add
str.Append(“<td>”); // begin cell
str.Append(“</td>”); // end cell
str.Append(“</tr>”); // end row
str.Append(“</table>”); // end table

2. Copying the HTML to the Clipboard:

See the message I wrote at the microsoft.public.dotnet.framework newsgroup: <a href=”http://groups.google.com/groups?th=5cc22c613a75e726″>http://groups.google.com/groups?th=5cc22c613a75e726</a&gt;.

Imported from legacy forums. Posted by Tommy (had 622 views)