I am sorting a dataview which is gained from the table of a dataset I have created (not data straight from a database). I have some code that at first seems to work, ie the data switches order, but the sort is incorrect. For example if i had the data 1,4,66,2,3 the data could come back for example as 66,4,2,1,3!!
I am thoroughly confused by this. The column names are all correct etc...
Please help if you have any thoughts or have seen this before.
Thanks in advance, Phil
Sub sortGrid(ByVal colName As String)
'get the dataset from the session item
Dim dsCurrent As New DataSet
dsCurrent = Session.Item("data")
'create a dataview to manipulate the data
Dim dataView As New DataView(dsCurrent.Tables(0))
'create the sort
dataView.Sort = colName & " DESC"
GridView1.DataSource = dataView