Gridview rowupdating gridviewupdateeventargs
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.
In that case a Text Box is created and added to the Controls collection for the appropriate cell (and it's the only item added to the Controls collection, so it's Controls).
We’ll get to how these properties are populated shortly, but first we need to go back to the Bind Data method.
The original method shown above did not implement any sorting, but now that we have a place to store the Sort Expression and Sort Direction we need to change that.
We’ll start with binding data to the Grid View, then build up functionality from there.
First, we’ll implement a method to databind the Grid View, which will be called whenever databinding needs to be performed.