Gridview Sorting:
The Gridview sorting can be done with little code block. The Gridview itself has two events for sorting and one property to enable the sorting. Look at the below picture to change the Gridview property and create onsorting event.
The Gridview sorting can be done with little code block. The Gridview itself has two events for sorting and one property to enable the sorting. Look at the below picture to change the Gridview property and create onsorting event.
In addition with the AllowSorting property set and event creation, we need to do some code in the event method. Look at the below picture, the red colored box indicates the property enabled with ViewState to hold what sortdirection had clicked. With the help of the property, we cross check and sort the session stored dataview and assign it back to Gridview. Before that we need assign the property to switch between ASC and DESC.
Hope this will help. Happy Coding...
No comments:
Post a Comment