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.
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.
Thanks for your reply. Maybe I didn't explain my problem properly.
My grid display 5 rows per screen and the active row is the 6th row. I rebind a new data source and then set the 6th row active.
When the grid is shown, the scrollbar scrolls to the next page. I don't want the user to see the proccess of scrolling.
Is there any way to let the grid show the second page when it is shown?