Home All Groups Group Topic Archive Search About

Multiple keys on sorted list?

Author
12 Apr 2005 5:29 AM
buzz
Is it possible to use multiple keys to sort a structure, such as LastName / FirstName in a sortedList?


--------------=  Posted using GrabIt  =----------------
------=  Binary Usenet downloading made easy =---------
-=  Get GrabIt for free from http://www.shemes.com/  =-

Author
12 Apr 2005 5:49 AM
Cor Ligthert
Buzz,

> Is it possible to use multiple keys to sort a structure, such as LastName
> / FirstName in a sortedList?

Not really, create for that you own collection using CollectionBase.

There is a complete sample on this page.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemcollectionscollectionbaseclasstopic.asp

I hope this helps,

cor
Author
12 Apr 2005 8:52 AM
Herfried K. Wagner [MVP]
"buzz" <Nowh***@justhere.com> schrieb:
> Is it possible to use multiple keys to sort a structure, such as LastName
> / FirstName in a sortedList?


You can create your own comparer object and pass it to the sortedlist when
it's created.

<URL:http://dotnet.mvps.org/dotnet/samples/codingtechnique/CompareOperator.zip>

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>