Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Persist Gridview data

Status
Not open for further replies.

kalkumar

Programmer
Jul 7, 2006
40
US
Hi,
I have a gridview User enter values into rows and with one button click I Want to save all data to Gridview. I am able to save all data from the Gridview to Database with one click.
Here my problem is :
On the Page_Load I am getting the data from Database. And storing it in the Data Table binding the datatable to Gridview.
The first column of Gridview getting the data from another apsx page. User add one row to gridview enter some data in that row. Again he clicking on addrow button which will add the row to gridview. This time the data entered in previous row is erasing. But
I need to persist the data in the previous row before adding the new row. Atlast I want to update all rows data into database with the Update button click which is outside of grdivew.
How to persist the gridview data.

Thanks
 
if you have a budget for development tools you could purchase a 3rd party GUI toolkit. All the major vendors have ajax enabled multi-record editors.

if not you need to design it from scratch.
save the datatable to viewstate (careful, this can bloat output)
bind the viewstated datatable to the gridview
then reference the datatable in the dataview to insert, update, delete records.
then click the save button and save the viewstated datatable to the db.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top