The Bind Grid() method is our own function that we will create later on.
The method essentially binds the Grid View with a Data View.
aspdotnet-suresh offers C#articles and tutorials,csharp dot net,articles and tutorials, VB.
There are many articles and tutorials around that illustrate the use of Grid View control along with the new Data Source Controls.
The Sort Expression property supplies the sort expression that you specified earlier for the column being sorted.
The Sort Direction property specifies the direction of sorting i.e. This property is not of much when you are sorting the grid on your own.
On Row Updating is fired when the 'Edit' button is clicked.Clicking on Update link button raises Row Updating event whereas clicking on the Cancel link button raises Row Canceling Edit event.We need to write our own code to update the new values back to the database in the Row Updating event.Further, you need to set Sort Expression property of the Bound Fields to the name of the column on which you would like to sort the grid.Once you set these properties you will find that the column headers of all the columns for which you specified Sort Expression property appear as clickable link buttons.Since we are not using data source controls we need to handle the toggling of the sort direction on our own. Add the following code in the Sorting event handler.Here, we store the value of Sort Expression property into a Veiw State variable called sortexpression. Finally, we call Bind Grid() method which will bind sorted version of the Data View with the grid.Clicking on the link buttons raise two events: Just like paging events these events follow pre and post pattern.The Sorting event allows you to cancel the operation also.The Data View supplies all the records from the Employees table.In order to implement paging you need to set Allow Paging property of the Grid View control to True. There are two events of Grid View that are related to paging.