This is a migrated thread and some comments may be shown as answers.

Mousewheel problem (introduced in Q3)

2 Answers 75 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
hwsoderlund
Top achievements
Rank 1
hwsoderlund asked on 13 Nov 2009, 09:56 AM
Hi, I noticed that the mouse wheel events seem to be "eaten" by the tree and not propagated to the parent container. I have all my trees inside scroll viewers, and on these I attach a behavior to get the mouse wheel functionality. So I am not using the MouseWheel event of RadTreeView at all. This used to work fine, but after upgrading to Q3 my scroll viewers no longer react to the mouse wheel events unless I position the mouse directly over the scroll bar. Is this a known issue? The XAML below should give you an indication of what I'm doing (I have removed all styling etc. for brevity). Let me know if you need more info.

<ScrollViewer> 
    <i:Interaction.Behaviors> 
        <b:MouseWheelScrollBehavior /> 
    </i:Interaction.Behaviors> 
    <Border> 
        <teleriknav:RadTreeView x:Name="TreeViewDomains"
        </teleriknav:RadTreeView> 
    </Border> 
</ScrollViewer> 

2 Answers, 1 is accepted

Sort by
0
Miroslav
Telerik team
answered on 15 Nov 2009, 08:39 PM
Hello Henrik,

The new thing in Q3 is the virtualization and scrolling is handled by the virtualizing panel.

I investigated the issue and here it is:
- There is a bug in the Silverlight ScrollViewer where the VerticalOffset will not be updated properly especially if it is updated in succession and by an IScrollInfo panel.
- The virtualizing panel handles the scrolling in the TreeView and it may happen to update the VerticalOffset of the ScrollViewer quickly (in succession).
- This is important in synchronous methods like GetItemByPath and BringIndexIntoView.

I will spare the details, but our workaround for this bug breaks the mouse wheel in this case. We were not aware of this - thank you for reporting it. I have attached a project where you can see that only the TreeView handles the quick scrolling changes expectedly.

Here is what I suggest:
1. If you want to use UI virtualization (the IsVirtualizing="true"):
- Any control placed in a ScrollViewer loses its virtualization. The control (the panel actually) needs to know about the ScrollViewer so that it extracts information about the visible parts from it. If you place the control in a ScrollViewer, it gets infinite space and therefore no items are virtualized.
In this case you will need to edit the TreeView's template and alter the ScrollViewer there.
 2. If you do not want to use UI virtualziation:
- We will make sure that the workaround I mentioned is not applied in this case. I have not tested this yet, but I do not expect issues there.
- In the meantime you can change the ItemsPanel of the TreeView back to the "good old" StackPanel. I expect that your behavior will work then, the code for this is:

<teleriknav:RadTreeView.ItemsPanel>
    <ItemsPanelTemplate>
        <StackPanel />
    </ItemsPanelTemplate>
</teleriknav:RadTreeView.ItemsPanel>

The changes in our code will be available with the next internal build and SP1.

Your Telerik Points have been updated.

Kind regards,
Miroslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
hwsoderlund
Top achievements
Rank 1
answered on 24 Nov 2009, 09:21 AM
Hi, thanks for the detailed answer. I have just upgraded to the latest internal build, and now it works just as before. :) Thank you.
Tags
TreeView
Asked by
hwsoderlund
Top achievements
Rank 1
Answers by
Miroslav
Telerik team
hwsoderlund
Top achievements
Rank 1
Share this question
or