views:

160

answers:

1

What actually happens internally when the user clicks a column header in a DataGridView? More specifically, if the first click sorts data ascending, how does it sort descending with the next click? Does it just negate the Compare() or CompareTo() result? And which interface does DataGridView use to sort items?

A: 

First click sets the SortExpression property, second click appends desc to the sort expression.

You have to write your own mod if you have a column with a multi-column sort expression as it ignores the first on click 2.