I'm trying to get my column to sort using the datagrid `SortMemberPath="COLUMN"` attribute and I get a weird sort order like so:

![enter image description here](https://i.stack.imgur.com/cUkPm.jpg)

It looks like the column is sorted on the basis of the first digit of the number and not the entire number. How can I fix this?

Edit:

Okay, I see what the problem is. I'm using this converter now but still no change. 

```
public class IntToStringConverter : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
        if (value is string)
        {
            string s = (string)value;
            int num;
            if (int.TryParse(s, out num))
                return Int32.Parse(s);
        }
        return DependencyProperty.UnsetValue;
    }

    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
    {

        int number = (int)value;
        return number.ToString();
    }
}

```

I added this to my xaml file Windows.Resource: 

```
<me:IntToStringConverter x:Key="IntToStringConverter"/>

```

and made this change in my data part:

```
<toolkit:DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding MinRun, Converter={StaticResource IntToStringConverter}}" HorizontalAlignment="Center" />
                        </DataTemplate>
                    </toolkit:DataGridTemplateColumn.CellTemplate>

```

Here is the DataGrid part of the XAML. Note that out of all the columns, I'm first trying to get the 'MinRun' column to sort properly first, then I'll use the same technique on the other columns. 

<http://pastebin.com/ec14p4ks>