p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

aspdotnet_website_programming thread: Getting data out of text boxes from the DataGrid


Message #1 by "Josh Bailey" <djbailey@l...> on Fri, 14 Jun 2002 18:47:43
I am using the DataGrid and the update built in functionality. Here is the 
process...
1. Click edit link and three fields are text boxes (for editing) and three 
fields are labels (can't be edited).
2. Change data in one of the fields and click the update link.
3. I use the following code to fet the data out of the text box...

Private Sub dgFacilities_UpdateCommand( _
                        ByVal source As Object, 
                        ByVal e As   
System.Web.UI.WebControls.DataGridCommandEventArgs) 
Handles dgFacilities.UpdateCommand

Dim oSub_Corp, oFacility, oSet_Of_Books As TextBox
'GET VALUES FROM THE TEXT BOX
oSub_Corp = e.Item.Cells(3).Controls(0)
oFacility = e.Item.Cells(4).Controls(0)
oSet_Of_Books = e.Item.Cells(5).Controls(0)

4. I then populate an SQL update statement.
5. HERE IS THE CATCH...When I check my sql in the immediate window the 
three text boxes have the OLD values and not the new values I typed 
in...what is the problem? Did I miss a setting?

Thanks

  Return to Index