Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
670
Event AfterColPosChanged giving wrong VisiblePosition
posted

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.

 

Parents
No Data
Reply
  • 469350
    Offline posted

    Hi,

    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.

Children