Sort not sorting numbers correctly.


Author
Message
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
I have a BO that is sorting on an int field (int in SQL Server). However the sorted results are as if the field was alpha-numeric. I.e. it sorts 1, 10, 11, 12, 2, ect. Am I missing a setting? The field is an Int32 in the BO.
Replies
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Just as a side note, you can get the behavior you want through a list...or any other type of object or collection for that matter.  You can create a comparer object that compares two values any way that you like.  In fact, the framework has a sorter for a ListView called the ListViewItemSorter.  This can be used as a column sorter on a ListView.
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
I've read about the comparers. I'm sure I'll be using them at some point. And yeah, I won't soon forget this lesson...I've got the scares to remind me BigGrin
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search