ListBox scrolling when item is clicked when using smooth scrolling

2 posts, 0 answers
  1. Nathan
    Nathan avatar
    12 posts
    Member since:
    Dec 2011

    Posted 15 Oct 2014 Link to this post

    I'm trying to use the RadListBox control because of it's drag and drop features, but am running into a problem that only shows up when smooth scrolling is enabled.  I've enabled smooth scrolling using the method posted elsewhere on the forums by setting the CanContentScroll property to False.

    However, when this is enabled, and I click on an item in the list, the whole list scrolls up so that the clicked item is at the bottom of the viewable area.  The resulting effect is that over several clicks, I've scrolled to the top of the list.  This behavior doesn't happen when the ListBox scrolls by item (when CanContentScroll is not set to false).

    I do not need the selection functionality of the ListBox, and I'm using it just for the built-in drag and drop features.  If there's another way to do the drag and drop without a Listbox, that's fine.

    I need the ListBox to not scroll when an item is clicked, or another solution to the problem.  Without a resolution, I cannot use smooth scrolling, as this will be a deal-breaker for any user.

    Here's a link to a project that will show the behavior:

    The project is for the Q1 2014 release, but I've tried the most recent one and I get the same results.
  2. Kalin
    Kalin avatar
    1190 posts

    Posted 17 Oct 2014 Link to this post

    Hello Nathan,

    We are already aware of the explained issue. However what I can suggest you would to remove the ScrollViewer.CanContentScroll="False" from the ListBox definition. And instead of that to apply different ItemsPanel, named ListBoxPanel, which supports the desired functionality. So the ListBox should look as shown below:

            ItemsSource="{Binding Items}">
            <telerik:ScreenshotDragVisualProvider />
            <telerik:ListBoxDragDropBehavior />
            <DataTemplate DataType="{x:Type local:Item}">
                <StackPanel Background="WhiteSmoke" Height="120">
                    <TextBlock Text="{Binding Name}"/>
                <telerik:ListBoxPanel />

    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. DevCraft R3 2016 release webinar banner
Back to Top