Hi,
I am trying to sort a generic list, but I get an error because the type I am trying to sort is different than the list type. Here is my code:
List<User> lMyList = GetData();
lMyList.Sort(delegate(CountryObj lCountry1, CountryObj lCountry2) { return lCountry1.Name.CompareTo(lCountry2.Name); });
The USER object has countryID as property, but I am using that countryID to get CountryName and assigns it to that property in the list. Is there anyway at all I can sort by country name although it's of type COUNTRY object not USER?
Any help will be very much appreciated.
E
...
Go to the complete details ...