Sorting works wrongly for the columns which has decimal values.

2 posts, 0 answers
  1. Senthil S
    Senthil S avatar
    16 posts
    Member since:
    Aug 2009

    Posted 29 May 2012 Link to this post

    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
  2. Carina
    Carina avatar
    41 posts
    Member since:
    Nov 2012

    Posted 17 Jun 2013 Link to this post

    Hi were you able to find a solution for this?
Back to Top