-
May 25, 2006, 04:37 PM
#1
win form 2003 Datagrid column sort on load
hello,
I need to sort a specific column of a datagrid in descending order on the form load event of a windows form
doing the sort in the sql query is not an option as my company is using visual developer and i don't have access to the query.
Does any one have any suggestion?
thank you
-
May 25, 2006, 05:06 PM
#2
found some code that will work
Dim mydv As DataView = New DataView
Dim columnname As String = Datagrid.TableStyles(0).GridColumnStyles(specificC olumnToSort).MappingName
Dim mydt As DataTable = New DataTable
mydt = Datagrid.DataSource
mydv = mydt.DefaultView
mydv.Sort = columnname + " DESC"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules