DataGridView Export

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have been unable to find a way, short of writing custom code, to export a
DataGridView to Excel (or a text document for that matter). I think that this
feature should be standard, but I'm having no luck. Any ideas?
Thanks in advance!
- Mike
 
That's questionable: Excel is a proprietary application and it can hardly
become a "standard output format".

But, said that, remember that Excel reads XML (moving from "propretary" to
capable of reading what has become cross-platform standard). So if you
carefully output your data to XML then Excel will be able to read it. You
can even add some "custom tags" to that file after data has been written to
it to have this XML associated with Excel (create simple Excel book, save it
as XML, and open this file with Notepad to see the contentm you'll see what
I'm talking about).
 
GreggMB,
Thanks for the feedback. I'll give that a try.

However, I'm not sure I totally agree with the "Proprietary" comment. The
DataGridView is as "Proprietary" as Excel is. Most 3rd party controls that
I've looked at have an Export to Excel feature. Why not microsoft? It would
only encourage programmers to stay within the Microsoft tool set and not
venture into 3rd party controls.
- Mike
 
Back
Top