Advertisement

06.26.2008 at 10:03AM PDT, ID: 23518982
[x]
Attachment Details

.Net 2.0 Dataview Sorting Problem

Asked by thom68 in .NET, Programming for ASP.NET, .NET Framework 2.0

Tags: .Net 2.0

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.DataSource = dv
Me.SortExpression = "LAST_NAME"
Me.grdSearchResults.DataSource.Sort = Me.SortExpression + " ASC"

thanksStart Free Trial
[+][-]06.26.2008 at 12:51PM PDT, ID: 21878371

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: .NET, Programming for ASP.NET, .NET Framework 2.0
Tags: .Net 2.0
Sign Up Now!
Solution Provided By: DanielWilson
Participating Experts: 1
Solution Grade: A
 
 
[+][-]06.26.2008 at 01:33PM PDT, ID: 21878744

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.10.2008 at 01:58PM PDT, ID: 21977336

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628