I have problem with sorting of one column. I have datagridview that is populated from dataset. It has one column named TimeInState, in it I need to show easy readeable period of time from last change. The input value from dataset is string in format 'MM/dd/yyyy hh:mm:ss'.
I use DataGridView CellFormatting event where i parse this string to DateTime and after that i made Substract to TimeSpan and from it, it create custom formated 'Time in State' text (it show how long is ticket there) like this '19 days,3 hours,56 min,31 sec'.
Everything work great except sorting. When i click on header and try to sort column it sort it like text and I need to sort it like DateTime.
I read that i can use ColumnSortModeChanged Event but i dont know how.
I hope that my question is clear :).
Thanks for any suggestion.