Home All Groups Group Topic Archive Search About

DataGrid on Update does not pass back values via e.Item.Cells[]

Author
21 Mar 2006 10:14 PM
davidjgonzalez
I am creating a generic DataSet update interface in VS 2003/ASP .NET.

I have an DataGrid that has AutoGenerateColumns = true and set whatever
DataSet i was to modify as the DataGrid.DataSource.

Viewing, Editing and Cancelling work, Updating values after an Edit
does not.

When I click the Update button on the DataGrid, the UpdateDataGrid
event fires.

In the Update DataGrid function i loop through the e.Item.Cells[] and
attempt read out all the values from the Controls. (eg.
((TextBox)e.Item.Cells[i].Controls[0]).Text)

For some reason all the Controls values are the empty string ("") even
though i updated the information on the web front end.

What could be causing all my Control values to be empty?

Also, e.Item.Cells[i].Controls[0] is of type
System.Web.UI.WebControls.TextBox.

Thanks

AddThis Social Bookmark Button