We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Grid scroll bar updating

Hi, I use a Form with a grid in it and I observe some strange behavior of the horizontal scroll bar. When I make the Form smaller with the maximize button (middle button upper right) the scroll bar is not refreshed when neccessary. When I then use the resize corner of the form (lower right corner) to resize the form the scroll bars are updated immediately with correct values. How can I achive that the scroll bars are always correct e.g. correctly updated? Calling Refresh() etc. on the grid does not update the scroll bars. Thanks Frank

7 Replies

AD Administrator Syncfusion Team October 8, 2004 08:52 AM UTC

Are you using the latest version, 2.1.0.9? This kind of behavior can be present if the gird is in a container (like a tabpage), an dthe grid is sized to the container before the container is finally sized on the form. Here is one technique that has avoid this problem in the past. Place a Panel in teh container where you are currently putting the grid (anchored/docked as the grid was anchored/docked). Then put the grid into the panel with the grid.DockStyle = fill.


FL Frank Laus October 8, 2004 10:24 AM UTC

Hi, yes, I''m using the current version. My Grid is added to a panel which is added to a tabbed pane. So in a way I''m already using the grid the way you describe it. I tried to add another pane between the form and my grid but the result was the same. Maybe there is a way to tell the grid to recalculate the scroll bars? This would do as a first workaround. Bye Frank


AD Administrator Syncfusion Team October 8, 2004 11:56 AM UTC

grid.UpdateScrollBars() will make it recalc scroll limits if needed. But this call is also done by calling grid.Refresh and you said this did not work. grid.PerformLayout() should make the grid lay itself out again. You might also try grid.ViewLayout.Reset().


FL Frank Laus October 11, 2004 08:46 AM UTC

Hi, All the method calls like Refresh() or UpdateXY() didn''t work. I just tested some operations with the grid and scroll bars and I can now describe the problem better. The problem seems to be that under conditions where not all columns are visible (due to scrolling) the grid view is not updated correctly. In a small window and after scrolling to the right there may be only two out of ten columns visible. When I now resize the window and make it larger the space for all columns may be sufficient again and the scroll bars are disabled - but the grid is not scrolled back to the left so there is no way to get back the formerly unvisible columns. There are still only two cols visible and the scroll bars are unusable (correctly, because the window is large enough). Any idea whether this is a bug or whether there is a workaround? It should be sth like scrolling the grid while/after resizing. Thanks Frank


AD Administrator Syncfusion Team October 11, 2004 09:31 AM UTC

I tried to see this behavior in this sample. It has a tabcontrol that has a grid in a panel on the second tab. Scrolling to the right and then sizing the form did not seem to cause a problem in this sample. Can you see teh problem in this sample? You might check exceptly how the grid is anchored or docked. If it has a free floating right edge, then sizing its parent smaller may effectively hide the grid''s client area on the right. In that case, there may be parts of th egrid you cannot see becuase th egrid''s parent is too small. WindowsApplication5_1712.zip


AD Administrator Syncfusion Team January 28, 2005 04:24 PM UTC

I''m seeing this very same problem. It doesn''t matter how the grid is docked. If you scroll all the way to the right, and then resize the window larger, the grid stays put (fully scrolled to the right). The empty space to the right of the grid gets bigger. The scrollbars may disappear if the window gets big enough. Thus, you cannot scroll back using the scrollbars, because they are disabled. Also, the scrollbars never seem to quite have the right values to enable scrolling all the way to the right (note that we are hiding some columns at run-time). This happens if the grid is dock-filled, or not.


AD Administrator Syncfusion Team January 28, 2005 04:28 PM UTC

Are you using 3.0.1.0? Can you send a sample to support@syncfusion.com showing the problem? Mention this forum thread in the subject line.

Loader.
Live Chat Icon For mobile
Up arrow icon