|
-
Jan 9th, 2009, 11:55 AM
#1
Thread Starter
PowerPoster
Sorting a custom collection
How is it possible to sort a custom strongly typed collection by a specific field of an object?
so I have a collection which is of type "Article"
I now want to add article objects to this collection BUT when it adds the item, I want to sort the collection by a specific field on the article (in this case, for example the ID field of type integer)
any ideas?
I am implementing the IComparable and overriding the CompareTo but doesnt seem to fire it. Also... inheriting from Collection<T>
Last edited by Techno; Jan 9th, 2009 at 12:28 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|