How can I enable automatic sorting of my BLL which returns a list, CustomerList:List in a GridView?
Customer is my own strongly typed class and CustomerList is a List of customers.
I know one approach is to set the AllowSorting property to true in the GridView and handle the OnSorting event and calling a sorting method defined in my CustomerList class.
However I would like a solution which is automatic in the sense that I do not have to handle the OnSorting Event, it should be like how GridView handles automatic sorting for DataView, DataTable, and DataSet.
Is there an Interface I need to implement on my CustomerList or Customer class that will enable that functionality?
alt text http://img260.imageshack.us/img260/3373/aa479347gridviewfg21enu.gif
Best Answer
Okay I figured it out. Here is the solution :
For more information see : http://msdn.microsoft.com/en-us/library/aa479347.aspx
Here's an example, this is just a quck example for demo I did not support sort direction, or optimized the code etc:
In the ASPX page :
For more information see : http://msdn.microsoft.com/en-us/library/aa479347.aspx