Last Updated: 12 Mar 2019 09:42 by ADMIN
Created on: 22 Apr 2015 15:05
Category: ListBox
Type: Bug Report
ListBox: The scroll moves when it is not needed, only if ScrollViewer.CanContentScroll="False"

Martin Ivanov
Posted on: 12 Mar 2019 09:42
Hello Shanthosh,

I am not sure that I understand what is the issue on your side. If it is related to this bug report, may I ask you to share some additional description by answering the following questions?
  • What is the expected result?
  • What is the exact issue?
  • How is reproduced?

If the issue is not related to this concrete bug report, I would ask you to open a new support ticket or a forum and post the description there.

Thank you for the cooperation.

Martin Ivanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Posted on: 05 Mar 2019 11:45

here im using telerik radlistbox, inside list box was not working, i tried using a parent control but it has no use...try to get me some idea to work inside a lstbox scroll.

Note : attached the o/p file



<UserControl x:Class="View.RoomTemplate"
             d:DesignHeight="600" d:DesignWidth="800">
        <ObjectDataProvider x:Key="RoomTemplateViewModel" ObjectType="{x:Type vm:RoomTemplateViewModel}"
    <ScrollViewer  VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" >
        <Grid DataContext="{StaticResource RoomTemplateViewModel}">
                <ColumnDefinition Width="5"/>
                <ColumnDefinition MinWidth="200"/>
                <ColumnDefinition MinWidth="200"/>
                <ColumnDefinition Width="5"/>
                <RowDefinition Height="5"/>
                <RowDefinition MinHeight="350"/>
                <RowDefinition Height="50"/>
                <RowDefinition MinHeight="50"/>
                <RowDefinition Height="20"/>
                <RowDefinition MinHeight="50"/>
                <RowDefinition Height="5"/>
                <RowDefinition />

            <local:Room x:Name="RoomView" Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="2" />
            <Label FontWeight="Bold" FontSize="20" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Left" Content="Available Rooms" />

            <telerik:RadListBox Grid.Column="1" Grid.Row="5" Grid.ColumnSpan="2" ItemsSource="{Binding RoomsList}" HorizontalAlignment="Left" Name="ListRooms" ScrollViewer.VerticalScrollBarVisibility="Visible"  PreviewMouseWheel="RoomView_OnPreviewMouseWheel">
                          <WrapPanel Orientation="Horizontal"/>
                    <DataTemplate >
                            <CheckBox Content="{Binding RoomInformation[0].RoomNumber}" IsChecked="{Binding RoomInformation[0].RoomChecked}"/>

            <StackPanel Grid.Column="1" Grid.Row="3" Grid.ColumnSpan="2" Orientation="Horizontal" VerticalAlignment="Center">
                <CheckBox IsThreeState="False" Content="Select All" IsChecked="{Binding SelectAllCheck}" Command="{Binding SelectAllCommand}"/>
                <Button Margin="15,0,0,0" Height="25" Width="100" Content="Apply" Command="{Binding ApplySettingCommand}"></Button>



 private void RoomView_OnPreviewMouseWheel(object sender, MouseWheelEventArgs e)
            var scrollViewer = (RadListBoxItem)sender;
            var list = GetChildOfType<ScrollViewer>(scrollViewer);
            if (list != null)
                if (e.Delta < 0)
                    list.ScrollToVerticalOffset(list.VerticalOffset +e.Delta);
                else if (e.Delta > 0)
                    list.ScrollToVerticalOffset(list.VerticalOffset - e.Delta);

        private static T GetChildOfType<T>(DependencyObject depObj) where T : DependencyObject
            if (depObj == null) return null;

            for (var i = 0; i < VisualTreeHelper.GetChildrenCount(depObj); i++)
                var child = VisualTreeHelper.GetChild(depObj, i);

                var result = (child as T) ?? GetChildOfType<T>(child);
                if (result != null) return result;
            return null;
Attached Files: