Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_professional thread: RE: Updating Cells in a DataGrid


Message #1 by Feduke Cntr Charles R <FedukeCR@m...> on Mon, 3 Jun 2002 08:24:33 -0400
Phil,

	You're casting e.item.Cells(2).Controls(0) as a Control or TextBox
or what?  Controls(0) could very well be a Hidden field with the original
values, whereas Controls(1) would be your TextBox.  The reason for this
would be for you to be able to build a SQL UPDATE statement if the field in
Cells(2) is the key field of the table.  Other than that my guess would be
that it is some weird quirk with ViewState.  Ensure the control in your
ItemTemplate is one of the <asp:* RunAt="server" /> controls; for odd
reasons any items that are not in ViewState are not returned in the
Request.Forms collection anymore.

HTH,
- Chuck

[posted to list archive for search results]

-----Original Message-----
From: Phil McAllister [mailto:PhilMc@8...]
Sent: Friday, May 31, 2002 2:19 PM
To: ASPX_Professional
Subject: [aspx_professional] Updating Cells in a DataGrid


PLEASE HELP ME.  When I examine the e.item.Cells(2).Controls(0) value, no
matter what I try, it seems that the original value, as opposed to the
current value, is always returned.  Here is what I mean:  If I successfully
populate my datagrid based on a query from my database, and the value in
e.item.Cells(2).Controls(0)is "Boston" . . . I TYPE IN the value of "Los
Angeles", then click UPDATE.  Once I do that, then check that particular
"Watch" value via debug (using a variable), the e.item.Cells(2).Controls(0)
value . . . is still returning "Boston".  I need to get the TYPED IN value
("Los Angeles" in this case).  I am going crazy here.  PLEASE help me.
Thanks.

Very Frustrated,

Phil



  Return to Index