Quote:
|
Originally Posted by petersza
Does anyone have any code, or can send me somewhere, that shows how to add data to a DataGrid control at runtime? I have the grid working with the Edit/Cancel/Update/Delete events, but I haven't been able to find out how to allow my users to *add* data to the grid.
Thanks,
Peter.
|
There are a few ways to do it, but picking a particular solution would depend on your intent.
I would check out:
http://groups.google.com/groups?hl=e...+into+datagrid
Several examples have been posted in those links. Check them out and pick which one works best for you.
In a nutshell, you can physically add a new row to the grid, but it won't be added to the database. Or, you can add a row to the database and it will load into the grid when the page is loaded again.