sortexpression considered as string instead of double

2 posts, 0 answers
  1. Blop
    Blop avatar
    19 posts
    Member since:
    Feb 2012

    Posted 19 Sep 2012 Link to this post

    Hello
    I've a listview,
    The datasource is a dataset builded like that:

    Dim dataSet As DataSet = New DataSet
    Dim dtPart As DataTable = New DataTable("Products")
    dtPart.Columns.Add("id", Type.GetType("System.String"))
    dtPart.Columns.Add("name", Type.GetType("System.String"))
    dtPart.Columns.Add("brand", Type.GetType("System.String"))
    dtPart.Columns.Add("price", Type.GetType("System.Double"))


    then I ve a method to sort it by price:

    Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            Dim expression As New RadListViewSortExpression()
            listview .SortExpressions.Clear()
            expression.FieldName = "price"
            expression.SortOrder = RadListViewSortOrder.Ascending
            listview.SortExpressions.AddSortExpression(expression)
            listview .Rebind()

    End Sub

    My issue is it sort by price considering the column as string. For instance:

    30 will be greater than 200

    How can I tell the sortexpressions that it sort decimals?

    Thanx 
  2. Andrey
    Admin
    Andrey avatar
    836 posts

    Posted 24 Sep 2012 Link to this post

    Hi,

    Could you share your full page source code along with the code-behind file content? Thus we will be able to examine your code and let you know what might be causing this behavior.

    Greetings,
    Andrey
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top