i need to sort a datatable according to a case on cell value i tried this:
DataTable dt = new DataTable();
...
dt.DefaultView.Sort = "Case When Col6 = 'open' then 1 When Col6 = 'approved' then 2 When Col6 = 'awaitingApproval' then 3 else 999 end asc";
but this fails. how can i whise a case cluase on datatable like i can write in the sql:
order by
Case
When Col6 = 'open' then 1
When Col6 = 'approved' then 2
When Col6 = 'awaitingApproval' then 3
else 999
end asc