Data Grid Sorting

Mick Dugan

Well-known member
Joined
Jun 15, 2003
Messages
45
Is there a way to have a data grid sorted automatically when the form loads?

Regards,

Mick Dugan
 
You can use a dataview to do that.

Code:
        Dim dvCustomers As New DataView(dsNW.Tables("Customer"))

        Sort the dataview by the customerID and in descending order
        dvCustomers.Sort = "CustomerID DESC"

        Bind the datagrid to the dataview and attach to the customer table of the dataview
        dgCustomer.DataSource = dvCustomers

Chester
 
Back
Top