Blank DataGrid

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

Guest

Is it possible to start with a blank datagrid and enter the information like an excel spread sheet? This doesn't seem to be the case. If it doesn't work that way, is there another control I can use other than inserting a spread sheet?
 
You could create a DataTable with however many columns you wanted to show
and bind the grid to it. Just declare a DataGrid, then Add three or four
(or whatever) DataColumns to it. If you want x amount of rows by default,
then just iterate through a counter and add a New DataRow each time.

HTH,

Bill
Eric said:
Is it possible to start with a blank datagrid and enter the information
like an excel spread sheet? This doesn't seem to be the case. If it
doesn't work that way, is there another control I can use other than
inserting a spread sheet?
 
Well,

The DataTable is a good idea but for performance simply create a DataTable
with 1 row and A through X columns (when X is reached have an event create
AA - AX... and so on) then on a DataGrid you will have an * which will allow
you to add to the DataGrid... when the user is done he can then press "Save"
and then you save the DataTable to a CSV or to a DB, or whatever datastorage
you want o use (XML is also an option)

Mitch
 
Back
Top