Unplanned
Last Updated: 22 Sep 2020 12:12 by ADMIN
Martin Ivanov
Created on: 15 Sep 2020 12:23
Category: AutoCompleteBox
Type: Feature Request
3
AutoCompleteBox: Allow vertical scrolling to bubble to a parent ScrollViewer

Currently, if you wrap RadAutoCompleteBox in a ScrollViewer (along with some other controls) and enable the vertical scrollbar of the child TextBox control, the scrolling doesn't bubble to the parent ScrollViewer when you reach the beginning (scroll up) or the end (scroll down) of the TextBox scrollbar.

Add an option or change the default behavior and allow the scrolling to bubble to the parent scrollbar. This behavior can be observed in the native TextBox control with an enabled vertical scrollbar.

For the time being, the MouseWheel event can be manually raised:

private void ScrollViewer_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
{
	if (sender is ListBox && !e.Handled)
        {
		e.Handled = true;
		var eventArg = new MouseWheelEventArgs(e.MouseDevice, e.Timestamp, e.Delta);
		eventArg.RoutedEvent = UIElement.MouseWheelEvent;
		eventArg.Source = sender;
		var parent = ((Control)sender).Parent as UIElement;
		parent.RaiseEvent(eventArg);
	}
}

2 comments
ADMIN
Martin Ivanov
Posted on: 22 Sep 2020 12:12

Hello Simon,

Thank you for the additional information.

Regards,
Martin Ivanov
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).

Simon
Posted on: 21 Sep 2020 05:40

Hi everyone,

Martin reported this feature request as a follow-up to our conversation in the forums. I just wanted to add a small repro case. Scrolling works fine as long as you don't hover the AutocompleteBox but stops working as soon as you hover it.

<Window x:Class="TelerikAutoCompleteBoxScroll.MainWindow"
                xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                Title="MainWindow" Height="350" Width="525">
    <ScrollViewer>
        <Grid>
            <telerik:RadAutoCompleteBox HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="0 100 0 5000" />
        </Grid>
    </ScrollViewer>
</Window>