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

RadSlider strange shrink behavior

3 Answers 159 Views
Slider
This is a migrated thread and some comments may be shown as answers.
Etienne
Top achievements
Rank 1
Etienne asked on 21 Dec 2016, 08:43 PM

Hi,

I've strange behavior with RadSlider inside a ScrollViewer. If the selection end thumb is at the maximum value and its container width is enlarged and then shrinked, the RadSlider doesn't shrink, it keeps the same size until the selection end thumb is moved to a lower value. It's is not the same behavior if the selection end thumb is not at the maximum value. I would have expect that the RadSlider shrink no matter the thumbs value.

I joined a sample project that reproduce that strange behavior. Just do the following steps : 1. Set selection end thumb to the max value 2. Enlarge window horizontally and shrink it back to original size.

Thanks for looking at this,

Etienne

I would have expect that the RadSlider shrinkno matter the thumbs value.
I would have expect that the RadSlider shrinkno matter the thumbs value.
I would have expect that the RadSlider shrinkno matter the thumbs value.
I would have expect that the RadSlider shrinkno matter the thumbs value.
I would have expect that the RadSlider shrinkno matter the thumbs value.

3 Answers, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 26 Dec 2016, 07:40 AM
Hi Etienne,

This happens because the ScrollViewer measures the RadSlider control with infinity and it gives it as much space as it needs. Once measured with a bigger size, the slider won't resize with a smaller size, because the scrollviewer shows its scrollbar and tells that there is no need to resize the control. 

In order to resolve this you can avoid setting the HorizontalScrollBarVisibility to Auto. Or you can manually set the Width of the RadSlider in code when the window is resized. 

Regards,
Martin
Telerik by Progress
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 allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Etienne
Top achievements
Rank 1
answered on 04 Jan 2017, 03:26 PM

Hi Martin,

Thanks for your reply. I understand the behavior you are describing but I don't understand why it's not the same behavior whether or not the end thumb is at the maximum value position.

Regards,

Etienne

0
Martin Ivanov
Telerik team
answered on 09 Jan 2017, 11:56 AM
Hi Etienne,

This happens because the size of the slider depends also on the selection thumbs. When the end thumb is at the maximum value, the slider extends a bit more than the ScrollViewer's width and the horizontal scroll bar appears.

Regards,
Martin
Telerik by Progress
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 allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
Slider
Asked by
Etienne
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Etienne
Top achievements
Rank 1
Share this question
or