I have dataview that i use as the datasource for a gridview on an ASP .Net web page. There are multiple sort options within each column. Most of the time the sorting works fine, but i have run into a scenario where it will not properly sort the data.
What happens is if you have in the column of the data table simple last names such as Test, Smith, and Builder. The problem is it is not properly sorting bogus last names like FTFXQWLC, MRBWBETG, CJQFKYFM, AND NLHYQEOP.
Even though they are not real names the sorting of them should still be easy but it sorts them in a random order. Is there some hidden sort logic in the dataview that it looks at capital letters differently?
I do the sort after i bind the dataview to the grid. Here is the code that works for most cases of sorting,
Dim dv As DataView
dv = getdata()
Me.grdSearchResults.DataSo
urce = dv
Me.SortExpression = "LAST_NAME"
Me.grdSearchResults.DataSo
urce.Sort = Me.SortExpression + " ASC"
thanks
Start Free Trial