DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Sat, 11 Aug 2007 17:48:13 +0300,    posted on: microsoft.public.dotnet.framework.aspnet.webcontrols        back       

Thread Index
  1    Haim Katz


Late bound sort of gridview   
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()
Date:Sat, 11 Aug 2007 17:48:13 +0300   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us