Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Datagrid Update - Rows Lost

Reply
Thread Tools

Datagrid Update - Rows Lost

 
 
Demetri
Guest
Posts: n/a
 
      11-15-2003
I have a datagrid on an aspx page with one column added via property builder - the edit/update/cancel. In addition there is a dropdownlist which has a list of table names.

Upon selecting one of the table names a post back is fired. During the post back the datagrid has columns added to it dynamically to represent each of the columns in the selected table

When the user clicks the edit button on a given row the cells then have textboxes added for user input

When the user clicks update after having made their changes a postback is fired and I attempt reference the textboxes only to find that there are NO cells any longer much less textboxes to reference in an effort to retrieve values to populate parameters for an update command object

If I rebind the datagrid before making the references to the textboxes it then contains the data BEFORE the user edited it therefore I lose their changes

Any ideas how I can keep from losing the textboxes to reference

And yes, I have enableviewstate set to true for BOTH the page and the datagrid specifically.
 
Reply With Quote
 
 
 
 
Aaron Weiker
Guest
Posts: n/a
 
      11-16-2003
On Sat, 15 Nov 2003 15:56:05 -0800, Demetri wrote:
> If I rebind the datagrid before making the references to the textboxes
> it then contains the data BEFORE the user edited it therefore I lose
> their changes.


Demetri,
The order in which things are bound will make a difference in this case.
First of all you will want to make sure that you only use DataBind() after
you have done everything with the data that was there previously (posted).
This means that you will want to handle the update then do the databind. In
order to provide more specifics it would be beneficial if you could post
any relevant code.

--
Aaron Weiker
http://aaronweiker.com
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Update Multiple Datagrid Rows Erik Lautier ASP .Net 1 04-08-2008 09:50 PM
1 global update button to update all rows in Gridview mesut ASP .Net 0 02-19-2007 02:00 PM
Datagrid Update - Rows Lost Demetri ASP .Net Web Controls 2 11-16-2003 01:36 AM
Datagrid Update - Rows Lost =?Utf-8?B?RGVtZXRyaQ==?= ASP .Net 1 11-16-2003 01:20 AM
To all Gurus: How can I edit/update a DataGrid in a DataGrid (nested DataGrid)? Possible? Andreas Klemt ASP .Net Datagrid Control 0 10-08-2003 01:19 AM



Advertisments