Problem while sorting the datagrid
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
Dim sortfield As String
sortfield = e.SortExpression
WhereSort = WhereSort & " order by " & sortfield
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.
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
By Bhargava in forum ASP.NET
Last Post: 11-19-2005, 02:00 AM
Last Post: 09-08-2005, 10:39 PM
Last Post: 08-01-2002, 10:54 AM
Last Post: 02-21-2001, 07:28 AM
By Heath in forum VB Classic
Last Post: 01-22-2001, 01:21 PM
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL