Hi,
I encountered a bug that in the event of AfterColPosChanged, the VisiblePosition returned from e.ColumnHeaders(0).VisiblePosition is wrong.
Example:
In the grid i have column1, column2 and column3 (Left to Right).
I removed Column2.
Drag Column1 into Column3 position.
Now in the AfterColPosChanged event, e.ColumnHeaders(0).VisiblePosition is 2, which is WRONG. It should be 1, because there is only 2 visible columns (zero based index)
Please help.
I'm not sure exactly what you mean by "I removed Column2." Is this an unbound column that you removed? Or did you mean that you are hiding the column?
I hidden column does not change it's VisiblePosition, so the numbers you are getting here are correct. The column is not visible when Hidden, but it maintains the same VisiblePosition. It has to do this, because otherwise when you hide a column and then show it again, it would not come back to the same position.