DataGridView - Sorting column through a button

1

I would like to know if there is any way to sort a column, from a datagridview, by clicking a button on the form after the DataGridView is already populated.

    
asked by anonymous 11.07.2018 / 01:15

1 answer

0

It is possible to Sort to columns after doing Binding this way:

DataGridView1.Sort(DataGridView1.Columns("Name"), System.ComponentModel.ListSortDirection.Ascending)

In any case, it is recommended that if the grid information comes from a SQL query, sort the records before the grid is popular.

    
11.07.2018 / 10:38