This question is locked. New answers and comments are not allowed.
I want to do an initial sort on a date column such that null values appear first and then non-nulls in descending order.
Using LINQ I can do it like this:
ListItemSet.OrderByDescending(d=>d.RequestDate == null).ThenByDescending(r=>r.RequestDate)
or
ListItemSet.OrderByDescending(d=>d.RequestDate == null ? DateTime.Now : d.RequestDate)
How can I achieve the same with the grid?
I tried this, but it doesn't work:
.Sortable(s=>s.OrderBy(f=>f.Add(r=>(r.RequestDate == null) ? DateTime.Now : r.RequestDate).Descending()))
Using LINQ I can do it like this:
ListItemSet.OrderByDescending(d=>d.RequestDate == null).ThenByDescending(r=>r.RequestDate)
or
ListItemSet.OrderByDescending(d=>d.RequestDate == null ? DateTime.Now : d.RequestDate)
How can I achieve the same with the grid?
I tried this, but it doesn't work:
.Sortable(s=>s.OrderBy(f=>f.Add(r=>(r.RequestDate == null) ? DateTime.Now : r.RequestDate).Descending()))