Re: Sorting Datagrid With Hyphen / Dash
From: Samuel Kim (look341_at_gmail.com)
Date: 03/08/05
- Next message: Samuel Kim: "Re: textbox.value"
- Previous message: Andrew Backer: "Re: Access a BoundColumn's value in Update, other than .Cells()?"
- In reply to: Chris Mayers via .NET 247: "Sorting Datagrid With Hyphen / Dash"
- Next in thread: Chris Mayers: "Re: Sorting Datagrid With Hyphen / Dash"
- Reply: Chris Mayers: "Re: Sorting Datagrid With Hyphen / Dash"
- Messages sorted by: [ date ] [ thread ]
Date: 8 Mar 2005 15:45:17 -0800
Due to their sequence in the ASCII set, - (hyphen) comes before the
numbers.
One way you can get around this behavior is to replace the hyphens with
underscore(_) character and do comparison.
If you change the hyphens to underscore, then you will need to revert
the changes once you are done - this you may not like so much.
To overcome this you can implement a class that implements the
IComparator interface and pass it along to the sort mechanism - the
IComparator instance can read the strings replace hyphen to underscore
and then compare. This will not require a change of your original data
and hence may be a cleaner solution - except for the fact that you need
to create another class.
- Next message: Samuel Kim: "Re: textbox.value"
- Previous message: Andrew Backer: "Re: Access a BoundColumn's value in Update, other than .Cells()?"
- In reply to: Chris Mayers via .NET 247: "Sorting Datagrid With Hyphen / Dash"
- Next in thread: Chris Mayers: "Re: Sorting Datagrid With Hyphen / Dash"
- Reply: Chris Mayers: "Re: Sorting Datagrid With Hyphen / Dash"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|