Wednesday, April 30, 2014

Sorting List in WPF C#

The easiest method to sort a List of string or any type do the follow

If List is string type

listData.Sort((a, b) => a.Count().CompareTo(b.Count()));

If List is any Class type

listData.Sort((a, b) => a.GameName.CompareTo(b.GameName));

No comments:

Post a Comment