Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Late bound sort of gridview

Reply
Thread Tools

Late bound sort of gridview

 
 
Haim Katz
Guest
Posts: n/a
 
      08-11-2007
I have a gridview in asp.net 2.0 which is late bound to a datasource
depending upon user selections on the form. The data shows up in the
grid, but clicking on the column headers does not sort the data and
causes it to disappear.

How can I handle the sort so that it works?

Here is the code:
Dim mywhere As String
Dim repview, selectstring As String
Dim myarg As New System.Web.UI.DataSourceSelectArguments()

'select clause that detects which report to load
Select Case Me.ddReptype.SelectedValue
....

Case 3 'Quality
repview = "QualityRepView"

End Select
selectstring = "select * from " & repview


'gets where clause from various dropdownlists
mywhere = getWhereClause()

selectstring += " Where " & mywhere

Me.GridView1.AllowSorting = True

Me.SDSReports.SelectCommand = selectstring
Me.SDSReports.Select(myarg)
Me.GridView1.DataSourceID = "SDSReports"
'Me.GridView1.DataSource = Me.SqlDataSource1


Me.GridView1.DataBind()
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Lower bound & Upper bound sunil panda Java 9 10-07-2008 08:32 PM
Sort GridView Bound to Collection of Objects rmgalante@yahoo.com ASP .Net 0 01-17-2007 03:19 PM
Get number of columns of a late bound GridView ctilly@gmail.com ASP .Net Web Controls 1 06-27-2006 12:53 PM
Getting lower-bound and upper-bound of strings input Rhiner Dan C++ 1 03-27-2005 02:03 AM
Ado sort error-Ado Sort -Relate, Compute By, or Sort operations cannot be done on column(s) whose key length is unknown or exceeds 10 KB. Navin ASP General 1 09-09-2003 07:16 AM



Advertisments