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
105
First line is scrolled out using Rows.move
posted

Hi,

I am trying to use the Move method on rows in my spreadsheet.
I my test case I have three line : when I move the first line to the second position (or the second to the first), I have a scrolling issue. The first line is "hidden" and a scrollbar appears on the right of the spreadsheet, where there was nothing before. As if I scrolled the first line out of view.

Anytime the first row comes into play, the problem occurs.

If I click the scrollbar or use my mouse wheel, the spreadsheet comes back in place and all my lines can be seen...

Here are some screenshots of the problem :

 

The current workaround I have found is to do :

Move Up method :

            if (orig_index == 1)
            {
                SprSheet1.SetActiveRow(1);
                SprSheet1.SetActiveRow(0);
            }

Move Down Method :

            if (orig_index == 0)
            {
                SprSheet1.SetActiveRow(0);
                SprSheet1.SetActiveRow(1);
            }

I have a flicker because of the updates but in the end the user is less confused and doesn't believe he "lost" a line in the process...

 

Any help on solving this problem more elegantly will be greatly appreciated :-)