473,387 Members | 1,721 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Sorting Lists Using IComparer

Hi,

I have implemened a class which is derived form IComparer to sort using
IComparer. The sorting is functioning well when the sorting objects are
different.
But. when the objects are equal the entire list get sorted.
Can anyone has a solution for this?

Thanks & Regards,
Leshan
Jul 4 '06 #1
1 1056
<=?Utf-8?B?U29ydGluZyBXaXRoIElDb21wYXJlcg==?= <Sorting With
IC*******@discussions.microsoft.com>wrote:
I have implemened a class which is derived form IComparer to sort using
IComparer. The sorting is functioning well when the sorting objects are
different.
But. when the objects are equal the entire list get sorted.
Can anyone has a solution for this?
I don't quite understand. Could you post a short but complete program
which demonstrates the problem?

See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Jul 4 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Federico G. Babelis | last post by:
Hi All: I have this line of code, but the syntax check in VB.NET 2003 and also in VB.NET 2005 Beta 2 shows as unknown: Dim local4 As Byte Fixed(local4 = AddressOf dest(offset)) ...
2
by: awiklund | last post by:
Hi, I am sorting an arrayList using a custom comparer, but it sort the element in a uncommon fashion. Take a look at this code. using System; namespace ConsoleApplication8
7
by: 00_ChInkPoIntD12 | last post by:
Can anyone confirm there isn't a Sort() method for WebControl Listbox in Asp.net? It is rather simple to write a method to do the sorting, but just wondering I shouldn't invent the wheel if...
19
by: Owen T. Soroke | last post by:
Using VB.NET I have a ListView with several columns. Two columns contain integer values, while the remaining contain string values. I am confused as to how I would provide functionality to...
3
by: marc | last post by:
Hi, I have a collection of objects and i would like to add a flexibel sorting functionality I am looking for a colliection that gives my the following functionality a - have enumaration to...
0
by: Brian Henry | last post by:
Here is another virtual mode example for the .NET 2.0 framework while working with the list view. Since you can not access the items collection of the list view you need to do sorting another...
1
by: Steph | last post by:
Hello, i dot not manage to write the code to sort a array on multiple columns. ArrayList people = new ArrayList(); people.Add(new Person("John", "Doe", 76)); people.Add(new Person("Matt", "Dire",...
3
by: Jesper, Denmark | last post by:
Hi, I've written a C++ program years ago, it's still in use in the company where I work, now its time to port it to .net, preferable managed code. However, I'm a little concerned about a sorting...
3
by: =?Utf-8?B?U2NvdHQ=?= | last post by:
Good afternoon, I would like to mimic the sorting capabilities in Excel where I can sort a list by up to four properties (columns in excel). I would like to pass a collection of objects to a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.