Problem while sorting the datagrid


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Problem while sorting the datagrid

  1. #1
    Join Date
    Nov 2005
    Posts
    1

    Problem while sorting the datagrid

    Hi guys,

    I have a data grid and i want to sort by clicking on any of the columns. I am giving the code here.


    Sub dgnotes_search(ByVal sender As Object, ByVal e As
    DataGridSortCommandEventArgs)
    Dim sortfield As String
    sortfield = e.SortExpression
    WhereSort = WhereSort & " order by " & sortfield
    GridNoteLoad(WhereSort)

    End Sub

    I did declared the wheresort as String and i am getting the error at "WhereSort" that 'too many arguments to private sub GridNoteLoad()'
    can you guys help me why i am getting this error..? appreciate your help.
    Thanks

  2. #2
    Join Date
    May 2005
    Location
    UK
    Posts
    278
    Are you binding the grid to a dataset having a table or are you using a dataview to bind
    The following should do the job

    DataView dv = dataset.DefaultView
    dv.Sort = e.Sortexpression
    Then bind the dataview to the grid and you should achieve the result
    You are including the keywork orderby in the sort expression you shouldnt add that keyword If you dont want to do the above use just the e.sortexpression as the parameter to your GridNoteLoad, The thing is i do not know what you are doing in you GridNoteLoad method
    Sri

Similar Threads

  1. Datagrid javascript problem
    By Bhargava in forum ASP.NET
    Replies: 1
    Last Post: 11-19-2005, 02:00 AM
  2. Paging and Sorting in DataGrid
    By THL in forum ASP.NET
    Replies: 4
    Last Post: 09-08-2005, 10:39 PM
  3. Threading and the .NET Datagrid
    By McCleud in forum .NET
    Replies: 2
    Last Post: 08-01-2002, 10:54 AM
  4. Replies: 3
    Last Post: 02-21-2001, 07:28 AM
  5. Datagrid control problem
    By Heath in forum VB Classic
    Replies: 1
    Last Post: 01-22-2001, 01:21 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center