Hi,
I need to sort a GridView (Not DataGridView, it's not the same thing) that is in need of a complex sort and I don't know how it can be done. I have two column, one containing a date and another containing a priority.
If the date is lesser or equal to today's date. I want to order by priority first, then by date. If the date is greater than today's date, I want to order by date first, then by priority.
Suppose totay is 2010-jan-13, some data ordered this way could look like these
date priority Explanation
----------- -------- --------------------------------------------
2010-jan-13 3 This comes first because it has the higer priority of all items whith a date <= today
2010-jan-12 2 Since this items and the next have the same priority they're ordered by date
2010-jan-13 2
2010-jan-14 5 This item and the followings have date > today, so they are ordered by date then by priority.
2010-jan-14 0
2010-jan-15 5
2010-jan-16 5
Is there anyway to sort a grid view mannually or by passing a compare functor?
edit : The datasource is a DataTable.