The described behavior is expected since the LoadOnDemand()
event is a routed event. Since you attach it to every RadTreeViewItem
, it is first handled by its source ("Team 1 \ John from Team 1
" for example) and then the event handlers of the parent elements are invoked (in this case the "Team 1" LoadOnDemand()
event handler) till the event reaches the root element of the visual tree.
This is why when you set a breakpoint in the LoadOnDemand()
event handler, it is hit twice. However, if you check the sender, you will notice that the objects raising the event are different. So in your scenario, you can handle the LoadOnDemand()
event in order to stop it propagating further in the visual tree:
sender, Telerik.Windows.RadRoutedEventArgs e)
RadTreeViewItem item = e.OriginalSource
currentItem = item;
System.Windows.Threading.DispatcherTimer pageTimer =
TimeSpan(0, 0, 0, 0, 1000);
I hope this information will help you. Let me know if I can further assist you.
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Telerik Public Issue Tracking
system and vote to affect the priority of the items