TheGateKeeper
TheGateKeeper

Reputation: 4540

Show excel like data in c#

I made a program that generates some data and want to show it in a grid like fashion like excel. What control should I use? I also want the user to be able to change the details if he wants to (like a textbox).

As an option step, is it possible to export this data to excel?

Thanks.

This is using c# and winforms

Upvotes: 1

Views: 3440

Answers (4)

code4life
code4life

Reputation: 15794

Looks like question #1 is answered, so I'll take a stab at question #2.

You can always save the gridview contents to a .CSV file format (comma separated values). Excel will automagically read that information into its workbook.

Upvotes: 0

Alex
Alex

Reputation: 468

what about DataGridView? make sure you set the DataSource...

DataTable dt = new DataTable();
//generate your data
dataGridView1.DataSource = dt;

Upvotes: 2

Vano Maisuradze
Vano Maisuradze

Reputation: 5909

You can use MS Office Excel activeX control to view/edit excel documents.

Also Excel Viewer is an option.

Upvotes: 0

Ted Xu
Ted Xu

Reputation: 1093

I strongly recommend you use c# with WPF, its rich UI element and plug-in are perfect for your purpose, you can use datagrid control to show your data in the excel fashion.

The excel export is simple, just use Microsoft.Office.Interop.Excel class.

Upvotes: 1

Related Questions