-
Problem with Updating a column in an ASP.Net Datagrid
I have been banging my head against a wall on this for several days now.
I
have a data grid with several columns, but only one is not a Read-Only
column. When I click the Edit link the column goes into edit mode
correctly. When I edit the value and click Update, I trace the code in the
UpdateCommand event and the value coming back from the grid is the original
value, not the updated value. In other words, if the value $300 was the
original value but then I changed the value to $200, only the $300 value
is
accessible in the code. I have the Select and the Insert for the data
adapter bound to two separate stored procedures. I don't have the columns
autogenerated. Since I have had so much trouble with this, I replaced the
updatable column with a template column in which I added two text boxes,
one
for the display and one for the update. I got the same results. I used
the
code I found in numerous example to extract the textbox object from the
Cells(ColumnPosition),Controls(0), and then get the text value of that
textbox control. In the template example, I use the FindControl method.
Does
anyone have any idea why this is occurring? I even tried creating a new
application with a new grid and copied in the code from my old app, thinking
that maybe the grid was corrupted. Still, the same results.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks