Solved

sorting objects in Array List

Posted on 2003-12-11
3
193 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now