User Profile
Collapse
-
I don't know how do continue the hierarchical sort logic. Please help. -
The Car class has CarMake, Year and CarModel as public string properties. However It would be great to find out how Year can be sorted by converting to a number. Also in your example CarMake sorting did not work for me as probably '>' was used. Any help will be appreciated a lot.
Thanks.Leave a comment:
-
Hi ,
I already do the following:
[code=#]
sortByCarMake = new SortByCarMake ();
list.Sort(sortB yCarMake);
public class SortByCarMake : IComparer
{
public SortByCarMake()
{
}
int IComparer.Compa re(Object x, Object y)
{
Car data1, data2;
if (TypeCheck.Empt y(x)...Leave a comment:
-
Hierarchical sorting of class stored in arraylist using c#
Hi,
I have code to store a custom class in an arraylist. CarMake, Year and CarModel are all properties inside the custom class Car for which data is stored in the arraylist. I need to sort the data according first based on CarMake. Then within CarMake the data needs to be sorted by Year and then within Year the data needs to be sorted by ModelName. Any help of how to do the above, will be greatly appreciated.
Thanks...
No activity results to display
Show More
Leave a comment: