Forgive the elementary nature of this question.
I am trying to update a datagrid. I'm just using the standard data adapter wizard to generate the commands for updating records.
I am able to view, cancel or delete records but I am not able to update. For some reason I am not able to get the updated values from the text box, even if I change the data it reverts back to the old value.
And as I stepped through the code, I realized the values weren't changing.
Here is an example :
I have view state turned on for both the page and the data grid. VS #2003
I am trying to update a datagrid. I'm just using the standard data adapter wizard to generate the commands for updating records.
I am able to view, cancel or delete records but I am not able to update. For some reason I am not able to get the updated values from the text box, even if I change the data it reverts back to the old value.
And as I stepped through the code, I realized the values weren't changing.
Here is an example :
Code:
private void dgd_UpdateCommand(object source, DataGridCommandEventArgs e)
{
TextBox txt = (TextBox)e.Item.Cells[3].Controls[0];
//Even though I am changing the data here it doesn't get represented in the text box, I'm still showing the same value as before
lblMessage.Text = txt.Text;
//Do some updating
}
I have view state turned on for both the page and the data grid. VS #2003