Print Page | Close Window

Multi-Column Sorting

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=123
Printed Date: 22-Oct-2025 at 4:12am


Topic: Multi-Column Sorting
Posted By: Linguinut
Subject: Multi-Column Sorting
Date Posted: 11-Jul-2007 at 5:08pm

Does anyone have a clear code example of sorting an entity list by two columns?  For instance, an employee list sorted by last name, then by first name.  I have read the BindableList(of T) doc, but am more confused on the issue than ever.

Thanks,
Bill




Replies:
Posted By: davidklitzke
Date Posted: 12-Jul-2007 at 8:18am
Bill,
 
Here is a simple example that sorts Employee by first and last name.
 
David
 
http://www.ideablade.com/forum/uploads/20070712_111800_Case419_SimpleA.zip - uploads/20070712_111800_Case419_SimpleA.zip


Posted By: Linguinut
Date Posted: 12-Jul-2007 at 9:49am
"Simple" is obviously a relative term.  Thanks a ton for the code example!  I am afraid that it does not pose itself as simple, though.  Simple is the SQL syntax of:
 
ORDER BY FirstName, LastName
 
I suppose a passthrough query would be an option rather than this IComparer shenanigans.  I'll give that a try, instead.
 
Thanks,
Bill



Print Page | Close Window