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:
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!
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!