sort datagrid

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In VB .NET I use datagrid to present information and when clicking on the column header, the entire datagrid is sorted. Besides CLICK, what're the other events associated with this type of action? Thanks.
 
You can use one line of code to create a dataview from the datatable.

Dim dv as DataView = WhateverDataTable.DefaultView

Now, bind the grid to the view instead of the table. All of your current
functionality will still be in tact.

You can call Sort on any field in the dataview and sort it which will cause
the grid to sort.You could offer this via a context menu for instance, if
for some reason you didn't want to allow sorting based on the grid headers.
http://www.knowdotnet.com/articles/dataviewsort.html
Tim said:
In VB .NET I use datagrid to present information and when clicking on the
column header, the entire datagrid is sorted. Besides CLICK, what're the
other events associated with this type of action? Thanks.
 
Back
Top