Fired event rowupdating which wasn t handled
We’ll revisit this method when we implement the sorting functionality.
We also need force databinding to occur when then page is loaded, which we’ll handle in Page_Load.
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).
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.
The important point is not which of these two events call Bind Data, but one of them must or the Grid View will not be updated. When bound using a Data Source ID, the Grid View internally tracks the current Sort Expression and Sort Direction, and those are available through properties with the same names.Once we have a reference to the Text Box, we set the new first name.For the Template Field, we do know the ID of the control since we specified it in the markup, so we obtain a reference to it by calling Find Control on the appropriate row of 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.
Search for fired event rowupdating which wasn t handled:
First, we’ll implement a method to databind the Grid View, which will be called whenever databinding needs to be performed.