I would like to sort ObservableCollection<myClass> which, except for the other things, contains the enum property such as following:
public IP_Enums.ExportType ExportType { get; set; }
Where the structure of enum looks like following:
public enum ExportType
{
A1,
A2,
B1,
B2,
B3,
C1,
C2,
D1,
D2
}
The problem I have is, that Export types under my ObservableCollection<myClass> are not in an order (as you can see in the enum definition), but like this e.g.:
[0].ExportType = ExportType.B2
[1].ExportType = ExportType.A1
[2].ExportType = ExportType.D2
[3].ExportType = ExportType.A1
I would like to sort my collection based on this ExportType, but I am not quite sure how to do it (as I have [A-Z] character followed by digit [0-9].
Any help would be highly appreciated.
yourCollection.Orderby(x => x.ExportType);is that what you want?myCollection.OrderBy()but it did not order collection by any means