How to enable Automatic Sorting of IEnumerable Data in GridView?
Posted
by ace
on Stack Overflow
See other posts from Stack Overflow
or by ace
Published on 2010-03-31T02:12:13Z
Indexed on
2010/03/31
2:13 UTC
Read the original article
Hit count: 337
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?
© Stack Overflow or respective owner