Solved

sorting objects in Array List

Posted on 2003-12-11
3
198 Views
Last Modified: 2010-04-16
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 " 
0
Comment
Question by:hema3i
3 Comments
 
LVL 20

Expert Comment

by:TheAvenger
ID: 9919722
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?
0
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 9919971
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.

AW
0
 
LVL 18

Accepted Solution

by:
testn earned 20 total points
ID: 9920311
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
System.Security 2 28
Question! 4 38
2 questions 10 29
The control parameters are not inputing the value when displaying in a report viewer 13 26
Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question