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
165
Scrollbar problem
posted

How can I set the initial position of the scrollbar of a wingrid?

I mean that when the grid is shown, the scrollbar is on the right position I've set, not first the default position and then scroll to position I've set.

Every time I rebind the datasource and set the activerow, the scrollbar scrolls.

If anyone knows, please tell me.

Thanks in advance.

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    If you set the DataSource of the grid and then set the ActiveRow immediately afterward, I would think that the grid would paint the first time and already be scrolled to the proper position. If the grid is scrolling twice, then something must be forcing the grid to paint in between settings the data source and setting the ActiveRow.

    Is your data source already loaded with data when you assign it to the grid? If you assign the DataSource first, and then populate it with data, this might cause the BindingManager to activate the first row in the grid and force a paint. In which case, you could get around it by either changing the order or setting SynchWithCurrencyManager to false.

Children