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

sortexpression considered as string instead of double

1 Answer 32 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Blop
Top achievements
Rank 1
Blop asked on 19 Sep 2012, 02:10 PM
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 

1 Answer, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 24 Sep 2012, 12:14 PM
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.
Tags
ListView
Asked by
Blop
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Share this question
or