This is a migrated thread and some comments may be shown as answers.

Disable ComboBox Auto Scroll Behaviour

12 Answers 719 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 03 Dec 2011, 11:05 PM
Hello,

I am wondering if it is possible to disable the autoscrolling behaviour in a combobox drop down (e.g. if last visible item in dropdown is selected the list jumps one item to bring the next item into view). Unfortunately this behaviour also fires when the mouse is hovered over the last visible item.

This is very irritating for my users where the combobox is located near the bottom of the screen and the list is displayed upwards. What usually happens is that the user clicks the combobox arrow, the list is displayed upwards and as soon as the mouse is moved up the list (passing the last item in the list which is not fully displayed) the whole list jumps by one. An even worse scenario is where the user scrolls the desired item into view (desired item is now at bottom of visible drop down) but as soon as he/she hovers over the item to click it it jumps up by one.

Is there an option / way to disable this?

Many Thanks,

Mike

12 Answers, 1 is accepted

Sort by
0
Valeri Hristov
Telerik team
answered on 06 Dec 2011, 08:21 AM
Hi Mike,

Unfortunately there is no way to disable this behavior. You could "hide" it to large extent by setting such MaxDropDownHeight on RadComboBox so it does not display some of its items partially. This depends on the themes, so I guess you should experiment a little until you find the right number. For example, MaxDropDownHeight=205 corrected the problem on my side (using the default theme).

Greetings,
Valeri Hristov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Mike
Top achievements
Rank 1
answered on 26 Dec 2011, 06:47 PM
Thanks Valerie, I did notice (as you suggest) that it does get better with adjusting MaxDropDownHeight. I am a bit concerned though that this might not work for all DPI settings?
0
Valeri Hristov
Telerik team
answered on 28 Dec 2011, 12:33 PM
I performed a quick test with 100%, 125% and 150% (the standard settings in Windows 7 control panel) and the WPF application UI scaled nicely without breaking the workaround I suggested.

By the way the auto scroll is a "feature" of the standard ScrollViewer in WPF - the standard WPF ComboBox also has it, in lower extent, however, because its dropdown is evenly sized with its items...

Greetings,
Valeri Hristov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Mike
Top achievements
Rank 1
answered on 29 Dec 2011, 10:18 PM
Thanks for trying this out, much appreciated.
0
srinivas
Top achievements
Rank 1
answered on 20 Jun 2017, 11:00 AM
Hi i am also looking a solution for this. items are getting scrolled automatically.
0
Dilyan Traykov
Telerik team
answered on 23 Jun 2017, 08:06 AM
Hello srinivas,

Please try setting the ScrollViewer.CanContentScroll attached property of the RadComboBox control to False and let me know how this goes.

Regards,
Dilyan Traykov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which you to write beautiful native mobile apps using a single shared C# codebase.
0
srinivas
Top achievements
Rank 1
answered on 23 Jun 2017, 10:12 AM
I tried the above suggestion ScrollViewer.CanContentScroll  to false.but it didnt worked 
0
Dilyan Traykov
Telerik team
answered on 26 Jun 2017, 12:49 PM
Hi srinivas,

I'm attaching a sample project where the aforementioned approach seems to work at my end.

Could you please have a look at it and let me know how it differs from your setup?

Regards,
Dilyan Traykov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which you to write beautiful native mobile apps using a single shared C# codebase.
0
Kevin
Top achievements
Rank 1
answered on 05 Aug 2019, 07:10 PM

For anyone who is still dealing with the auto-scrolling, I've found that this works:

1. Add an EventSetter to the item container style:

<telerik:RadComboBox>
    <telerik:RadComboBox.ItemContainerStyle>
        <Style TargetType="telerik:RadComboBoxItem">
            <Setter Property="Padding" Value="0"/>
            <EventSetter Event="RequestBringIntoView" Handler="RadComboBoxItem_RequestBringIntoView"/>
        </Style>
    </telerik:RadComboBox.ItemContainerStyle>
    <!-- Your other code here -->
<telerik:RadComboBox>

 

2. Implement the handler so that it sets Handled to True:

private void RadComboBoxItem_RequestBringIntoView(object sender, RequestBringIntoViewEventArgs e)
{
    e.Handled = true;
}

 

I did this, and the auto-scrolling stopped.

0
Dilyan Traykov
Telerik team
answered on 07 Aug 2019, 12:02 PM
Hello Kevin,

Thank you very much for sharing your solution with the community.

Regards,
Dilyan Traykov
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.
0
Andy
Top achievements
Rank 1
answered on 27 Sep 2019, 10:35 AM
Thanks for this solution. Setting ScrollViewer.CanContentScroll="False" solves the problem with the auto scroll. It was a big problem on my side with a new ComboBox I just implemented.
0
Dilyan Traykov
Telerik team
answered on 27 Sep 2019, 11:16 AM

Hello Andy,

I'm happy to hear that the proposed solution worked for you. Should you come across any other issues, do not hesitate to contact us again.

Regards,
Dilyan Traykov
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.
Tags
ComboBox
Asked by
Mike
Top achievements
Rank 1
Answers by
Valeri Hristov
Telerik team
Mike
Top achievements
Rank 1
srinivas
Top achievements
Rank 1
Dilyan Traykov
Telerik team
Kevin
Top achievements
Rank 1
Andy
Top achievements
Rank 1
Share this question
or