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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

datagrid

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have a datagrid with edit, when I click edit & enter the new values into the textbox, the new values are not coming across. Here is snippet...

private void DataGrid1_UpdateCommand(object source, system.Web.UI.WebControls.DataGridCommandEventArgs e)

TextBox txtDate = (TextBox) e.Item.Cells[3].Controls[0];

String strDate = txtDate.Text;

....

say the date was "11/27/2002" & I change it to "01/02/2002", "11/27/2002" is what is saved to the databse. If i hardcode the values say String strDate = "01/02/2002" the stored procedure updates the database fine, what is wrong?
 
Something to try:

in vb.net, the e.item.cells(index).controls(0) is actually considered the cell itself.

What we had to do was change the controls index to 1, and then we were able to access the text box.

So for your code, it would be:
TextBox txtDate = (TextBox)e.Item.Cells[3].Controls[1]

Hope this helped.

Jack
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top