I have a grid displaying a list of objects that have a Date field.
I want to group these by: those with a Date of "Today", "Yesterday" and "Older than that". I also want so that the Today group comes before the yesterday group, etc.
Alphabetically, "Older.." comes before "Today" which comes before "Yesterday".
How do I get the grid to group by these categories with clean titles, and order the groups as desired?
One of my attempts was:
I created another field in the objects that returns an enum corresponding to these states. Unfortunately, there is no way to override ToString for enums, or to specify how to sort them.
I then created a DateRegion object and added a field in my object class that returns a DateRegion object. This object has a Text Field that corresponds to the categories above. Unfortunately the grid seems to sort alphabetically by this Text.
Any ideas? Am I being clear?
I want to group these by: those with a Date of "Today", "Yesterday" and "Older than that". I also want so that the Today group comes before the yesterday group, etc.
Alphabetically, "Older.." comes before "Today" which comes before "Yesterday".
How do I get the grid to group by these categories with clean titles, and order the groups as desired?
One of my attempts was:
I created another field in the objects that returns an enum corresponding to these states. Unfortunately, there is no way to override ToString for enums, or to specify how to sort them.
I then created a DateRegion object and added a field in my object class that returns a DateRegion object. This object has a Text Field that corresponds to the categories above. Unfortunately the grid seems to sort alphabetically by this Text.
Any ideas? Am I being clear?