How to remove the "sort arrow" from datagrid column heading?

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

Guest

I have a sortable grid with 3 columns, so when I click in any of the column
headings, an arrow appears indicating the sort order. When I press button X
on my panel, I'm reloading the grid with original sort order, so I need to
make the "sort arrow" disappear. The following seems to be the only thing
that hides the arrow (given i variable keeps track which column has been
sorted last), is there anything else that accomplishes the same thing, but
takes less time? I'm looking for something that would reset all the columns
at once. I tried me.dgvTables.Refresh() and it didn't do the job.

Me.dgvTables.Columns(i).SortMode = DataGridViewColumnSortMode.NotSortable
Me.dgvTables.Columns(i).SortMode = DataGridViewColumnSortMode.Automatic

Thank you for your help.
 
Back
Top