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

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top