How to enable Automatic Sorting of IEnumerable Data in GridView?
- by ace
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 call 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?