Gridview and list <>
4 answers
Try this tutorial -
Sorting a GridView with IComparer
In conclusion, you can use the IComparable interface to define a custom sort based on which header column you click.
Hope it helps.
Josh
+1
source share
Programmatically,
You may need to sort List<>
before binding to the gridview.
Or, you may need to explicitly point gridview.DataSource
to List<>
and sort it.
If you want to sort the gridview in your GUI, you need to set a gridview.AllowSorting
property true
, then you should be able to sort.
0
source share