I have a wpf datagrid. I assign ObservableCollection to it.
DG1.DataContext = a;
One of the columns is having values like following
1_A_B
12_A1_B
3_A2_B
10_A3_B
2_A4_B
15_A5_B
i want to sort the datagrid using the first integer value like following
1_A_B
2_A4_B
3_A2_B
10_A3_B
12_A1_B
15_A5_B
If i sort using this column, it is taking as string ascending like following(which is not i want)
1_A_B
10_A3_B
12_A1_B
15_A5_B
2_A4_B
3_A2_B
I want to sort using the first integer value in above column
AutoGenerateColumns? Can you add another column to view model of the row that would give you first part of that value as int?