You could implement the IComparer interface & use an ArrayList to store the
contents that are used to populate the ListBox, now pass the comparer when
using the Sort method.
public class MyComparer : IComparer
{
/*
Less than zero
x is less than y.
Zero
x equals y.
Greater than zero
x is greater than y.
*/
public int Compare(object x, object y)
{
int nx = Int32.Parse((st ring)x);
int ny = Int32.Parse((st ring)y);
return nx.CompareTo(ny );
}
}
I see that your listbox is a numeric string, so you can implement your custom
logic in the Compare method above.
-Arun
Hi, I'm using vs2005, .net 2 for C# windows application.
One of my column on the Listview control has numericstring. Other
columns
are sorting correctly except this one. It seems to be sorting the 1st
numeric char at the beging of the string. How do I resolve this
problem?
Thank you?