Showing posts with label Telerik WinControls. Show all posts
Showing posts with label Telerik WinControls. Show all posts

Nov 23, 2011

Scroll event not fired in some Telerik Windows Forms Controls (maybe WPF as well)


First of all - this is not quite an issue.
Since the Telerik controls are compound controls (for example the list view has Root Element, List Element, things like that), what scroll are you subscribing to?

Do you subscribe to the whole control?
Do you subscribe to the RootElement? To the ListView?

To remove that kind of questions, Telerik came up with the idea that it will be better to rise the appropriate control scroll, instead the entire control scroll.
Consider this:

radListControl1.Scroll

vs:

radListControl1.ListElement.VScrollBar.Scroll

If you are called like the first one, how do you know who called you?
If you are called in response to the second one, however, you will know that the ListElement (the items placeholder) has changed its vertical scroll so you can respond to this easilly (for example in a case of Virtualization it will mean it may be hungry for some more items ;).

To be honest at first I was a bit frustrated but now when I got it it makes a lot of sense.

Disclaimer: I am not part of Telerik anymore so this is just my guess, why they did it that way and my own explanation. I may be wrong :).