• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 204
  • Last Modified:

sorting objects in Array List

hi i've an Array List "Mails" Whic Contains Set of bjects."Email".
The Email .Contais The Following Attributes
string Subject.
string From.
string Date.
If i Want To Sort this objects on Subjet or ,From or Date
or both Subject and From etc...
or on the three subject,from,date.
how this could be done.
"Note i'll increase the points to 50 ,till now i've only 20 point " 
1 Solution
How do you want to use this array afterwards? Shall it be able to dinamically resort? Can you use the SortedList or it does not work for you?
In order to sort the elements, your EMail class must implement the IComparable interface, and you must supply the Compare methods necessary for the sort to be carried out.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

7 new features that'll make your work life better

It’s our mission to create a product that solves the huge challenges you face at work every day. In case you missed it, here are 7 delightful things we've added recently to monday to make it even more awesome.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now