GridView RowUpdating textbox.Text = ""
-
Hi, I have written an user control with a gridview control, that does select, edit, update, cancel functionality. I have a question regarding the RowUpdating event. I bind my grid at runtime to a generic list<>, therefor I can't use the oldvalues, newvalues or the keys as you need a datasource control with an update command to be able to use these dictionaries. Another thing is that I have the autogeneratefields = true (as I am creating a generic gridview) and therefor I cannot use the gridview.columns[].extractvaluesfromcell as the columns count = columns created at design time to add the select, edit, update, cancel buttons. I have used the following code: ((TextBox)gridview.Rows[e.RowIndex].Cells[5].Controls[0]).Text which results in "". However the old values are still available. The newly typed data not available. Any help will be greatly appreciated. Thanx
-
Hi, I have written an user control with a gridview control, that does select, edit, update, cancel functionality. I have a question regarding the RowUpdating event. I bind my grid at runtime to a generic list<>, therefor I can't use the oldvalues, newvalues or the keys as you need a datasource control with an update command to be able to use these dictionaries. Another thing is that I have the autogeneratefields = true (as I am creating a generic gridview) and therefor I cannot use the gridview.columns[].extractvaluesfromcell as the columns count = columns created at design time to add the select, edit, update, cancel buttons. I have used the following code: ((TextBox)gridview.Rows[e.RowIndex].Cells[5].Controls[0]).Text which results in "". However the old values are still available. The newly typed data not available. Any help will be greatly appreciated. Thanx
Have you checked the array of Controls? I my websites it its always Controls[1]