Detailsview1 fired event itemupdating
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.Since it’s a Bound Field, the Text Box is going to be Control.Once we have a reference to the Text Box, we set the new first name.In both cases, the controls are added to the controls collection for the cell.You can see that in the case of a Template Field, the exact spacing within the control becomes significant, so it’s generally better to get a reference to the control by ID using Find Control than to use the Controls collection.When the Bound Field is in Edit mode, things are a little different.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 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 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).
NET 2.0 most of the examples and tutorials deal with setting the Data Source ID, which buys you a lot of automation that you may not even appreciate unless you’ve done this the old fashioned way.
In this example, we’ll go through a fully featured Grid View with editing, deleting, selecting, sorting, and paging functionality that is manually bound and identify the limitations and some of the workarounds. Sql Data Source, Object Data Source, Linq Data Source, etc) specified in a Data Source ID, the Grid View can automate many functions because, through the data source control, the Grid View on its own can perform the following operations: When you manually bind data to a Grid View, the Grid View itself cannot perform these operations, so they must be implemented in your code.