This question is locked. New answers and comments are not allowed.
I have a RadGridView with the following properties:
When I try to sort by week, I get the "classic" string-sort problem, e.g.
10
11
4
42
7
I've tried setting the DataType programatically:
But it doesn't help.
I've searched high and low in the forum and stumbled upon someone mentioning a numerical column, but I can't find that in the documentation. It seems a bit overkill to make custom sorting on a column that contain integers, so I would very much like to find a solution to this problem, since I have other columns with the same problem.
So - how do I sort a column based on numerical values?
I'm using the Q3 2011 version
Best regards
Søren Hansen
telerik:RadGridView x:Name="SearchResult_DataGrid" Grid.Row="2" AutoGenerateColumns="False" IsReadOnly="True" RowIndicatorVisibility="Collapsed" CanUserFreezeColumns="False" CanUserResizeColumns="False" DataContext="{Binding}" ItemsSource="{Binding Path=Data}" SelectedItem="{Binding Path=SelectedItem, Mode=TwoWay}" MouseRightButtonDown="SearchResult_DataGrid_MouseRightButtonDown" ShowGroupPanel="False" ><telerik:RadGridView.Columns> <telerik:GridViewDataColumn DataMemberBinding="{Binding Date}" Header="Date"/> <telerik:GridViewDataColumn Header="Week" DataMemberBinding="{Binding Week}" /></telerik:RadGridView.Columns></telerik:RadGridView>When I try to sort by week, I get the "classic" string-sort problem, e.g.
10
11
4
42
7
I've tried setting the DataType programatically:
var column = SearchResult_DataGrid.Columns["Week"] as Telerik.Windows.Controls.GridViewBoundColumnBase;if (column != null){ column.DataType = typeof(int);}But it doesn't help.
I've searched high and low in the forum and stumbled upon someone mentioning a numerical column, but I can't find that in the documentation. It seems a bit overkill to make custom sorting on a column that contain integers, so I would very much like to find a solution to this problem, since I have other columns with the same problem.
So - how do I sort a column based on numerical values?
I'm using the Q3 2011 version
Best regards
Søren Hansen
