Thanks for writing.
RadDataBoundListBox implements a custom UI virtualization mechanism that uses the change of visual states of the ScrollViewer
(scrolling -> not-scrolling -> scrolling) to trigger the UI virtualization logic. When you directly set the scrolloffset of the ScrollViewer
component the UI virtualization mechanism is bypassed and therefore you get the undesired behavior you observe.
While in some cases explicitly setting a scroll offset might work as expected, in other cases this might not yield the expected result. Imagine that you set a big enough scroll offset that makes all realized items be recycled and disappear: what would be the data index to start realizing from based on the scroll offset provided that items may have different sizes? We may use some predictions but ultimately the behavior will not be deterministic.
Otherwise you can trigger the virtualization logic by calling the BalanceVisualSpace
method which is defined by the base RadVirtualizingDataControl
class and is internal.
You should use reflection
to do that.
I hope this helps.
Have a suggestion or face a problem - you can use the Ideas & Feedback portal
to submit ideas, feedback and vote for them.