Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I have created classes and containe

Status
Not open for further replies.

mddittman

Programmer
Sep 3, 2003
5
US
I have created classes and container classes similar to the following article:


The main difference is that I've altered the Sort class to accept a string parameter for the field to be sorted, and created the appropriate sort classes.

I have implemented the Sort functionality, but I would like to be able to sort on more than one field, for example, sort by lastname then firstname. If would like to do the following:

Code:
customer.Sort("FirstName")
customer.Sort("LastName")

Using this, I can sort by any field that I want. I would expect after running the above code that the InnerList would be sorted by first name, then by last name. The problem is that for some reason the InnerList doesn't 'remember' the previous sort. Does anyone have any insight on what I'm doing wrong, or how I can implement multiple field sorting for my collection classes?

Thanks!
 
>> how I can implement multiple field sorting for my collection classes?

Did you write a Compare function? If so that is where you need to implement your logic. If you did not write one then you need to.

-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top