Prevent Scroll Jumping When Selecting an Item in a Grouping Scenario With ScrollViewer.CanContentScroll Set to False.
Environment
Product Version | 2024.2.514 |
Product | RadListBox for WPF |
Description
Selecting an item when grouping is applied and the ScrollViewer.CanContentScroll
is set to False causes the RadListBox
's scrolling to jump.
Solution
To disable this behavior, set the IsScrollIntoViewEnabled
property of the RadListBox control to False. This will disable the automatic scroll into view logic when selecting a new item.
Setting the IsScrollIntoViewEnabled property of RadListBox to False
<telerik:RadListBox
DisplayMemberPath="MyPropertyName"
IsScrollIntoViewEnabled="False"
ItemsSource="{Binding MyCollection}"
ScrollViewer.CanContentScroll="False">
<telerik:RadListBox.GroupStyle>
<GroupStyle />
</telerik:RadListBox.GroupStyle>
</telerik:RadListBox>