Rowupdating which wasn

6854933580_2c8b688306_z

The Grid View Row is the naming container for the Text Box in this case, so we need to call Find Control on the appropriate row, but we do not need to call it on the specific cell.

Once we have a reference to the Text Box, we set the new last name and save the changes (through the Submit Changes method).

The required actions for paging to work are setting the new page index, setting the Data Source, and calling Data Bind (the last two through the Bind Data method).

rowupdating which wasn-5rowupdating which wasn-77rowupdating which wasn-72rowupdating which wasn-9

We’re using Linq to SQL to pull data from our database and bind it to the Grid View.When you manually bind the Grid View, this tracking does not occur, so we must implement some mechanism for tracking those values.We also want it to be something persistent, so that, for example, if you sort, then page, the sort is maintained.Finally we need to populate the Sort Expression and Sort Direction when they change, and we’ll handle that in the Sorting event. Also like paging, so show that it does get called, databinding is handled in the Sorted Event ( First, we obtain the User ID of the affected row from the Grid View Data Keys collection, which we use to pull the appropriate record from the database.At that point we need to get the new values so we can update the record, which is done slightly differently for the Bound Field and the Template Field.Once we have a reference to the Text Box, we set the new first name.

You must have an account to comment. Please register or login here!