rotsey Posted April 29, 2005 Posted April 29, 2005 Hi, I have an ArrayList of structures and I want to sort the array on different members of the structure so that I can give a rank each element of the array. So I thought I would sort it for each member in turn add add a rank member to the structure for each member i want to sort Confusing I bet. How else would you do this? I want to step through a database fill an array then sort by differen members and then rank each member in the array so that I can create a table with the member values and there rank next to it Thanks for any help given Malcolm Quote
HJB417 Posted April 29, 2005 Posted April 29, 2005 I would create an IComparer that can perform any/all required sorts, or you could create a class for each type of sorts. The ArrayList.Sort method is overloaded and one or more methods take an IComparer as an argument. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.