RadListBox prevent scrollviewer to scrool with mouse wheel

3 posts, 1 answers
  1. Etienne
    Etienne avatar
    51 posts
    Member since:
    Sep 2014

    Posted 05 Mar 2015 Link to this post


    I have some RadListbox inside a ScrollViewer and I would like to be able to scroll with the mouse wheel anywhere inside the scrollviewer.
    I'm aware that the RadListBox has a ScrollViewer in his template that capture the MouseWheelEvent so I changed the template by the following.

    <Style x:Key="UnscrollableRadListBoxStyle" TargetType="telerik:RadListBox" BasedOn="{StaticResource RadListBoxStyle}">
            <Setter Property="telerik:ScrollingSettingsBehavior.IsEnabled" Value="False"/>
            <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Disabled"/>
            <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"/>
            <Setter Property="Template">
                    <ControlTemplate TargetType="telerik:RadListBox">
                            <Border Padding="{TemplateBinding Padding}"
                                    Background="{TemplateBinding Background}"
                                    BorderBrush="{TemplateBinding BorderBrush}"
                                    BorderThickness="{TemplateBinding BorderThickness}">
                                    <KeyBinding Command="telerik:ListControl.SelectAllCommand" Key="A" Modifiers="Control"/>
                            <ContentPresenter x:Name="PART_DropVisualPlaceholder" Visibility="Collapsed" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>

    Now, the scroll works great, I can scroll with the mouse wheel everywhere. The problem is that when I drop an item inside one of the RadListBox, the DropVisualPlaceHolder appear at wrong place.

    Do you have any idea of what I've done wrong ?

    Thank you,

  2. Answer
    Geri avatar
    62 posts

    Posted 09 Mar 2015 Link to this post

    Hi Etienne,

    Thank you for contacting us.

    It turns out this behavior is caused by an inaccuracy in the way the position of the DropVisualPlaceHolder is calculated. We updated your Telerik points for bringing this to our attention. The issue is logged in our system, you can track its progress here. We're sorry for any inconvenience caused.

    Fortunately, we were able to come up with a workaround by creating a custom DropVisualProvider.
    Please take a look at the attached project and tell us if it works for you.

    Hope this helps.


    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

  3. Etienne
    Etienne avatar
    51 posts
    Member since:
    Sep 2014

    Posted 11 Mar 2015 Link to this post

    Hi Geri,

    Thanks for the workaround, it works great!

Back to Top