This is a migrated thread and some comments may be shown as answers.

Sorting works wrongly for the columns which has decimal values.

1 Answer 147 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Senthil S
Top achievements
Rank 1
Senthil S asked on 29 May 2012, 12:09 PM
Hi,

I am using silverlight 4.Sorting is not working properly in the gridview.

For ex:If one of the column in the Grid has the values like

112.45
23.00
112.46
45.00
42.00
0.00
2.00

If i sort with Ascending order it sorts like
0.00
112.45
112.46
 2.00
23.00
42.00
45.00

 For 
descending its sorts like
45.00
42.00
23.00
2.00
112.46
112.45
0.00


it sorts as if it has a string values.But the SQL query that i am using for the populating the grid has only the decimal value.

Even i have changed the datatype of that particular column to decimal.But it is sorting as if they have 'String' values.
Dim gridViewBoundColumnBase = TryCast(grdAddAssignments.Columns("Distance"), Telerik.Windows.Controls.GridViewBoundColumnBase)
If gridViewBoundColumnBase IsNot Nothing Then
    gridViewBoundColumnBase.DataType = GetType(Decimal)
End If


Thanks in Advance

Senthil

1 Answer, 1 is accepted

Sort by
0
Carina
Top achievements
Rank 1
answered on 17 Jun 2013, 10:32 PM
Hi were you able to find a solution for this?
Tags
GridView
Asked by
Senthil S
Top achievements
Rank 1
Answers by
Carina
Top achievements
Rank 1
Share this question
or