RadSlider strange shrink behavior

4 posts, 0 answers
  1. Etienne
    Etienne avatar
    51 posts
    Member since:
    Sep 2014

    Posted 21 Dec 2016 Link to this post

    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.
  2. Martin Ivanov
    Admin
    Martin Ivanov avatar
    1336 posts

    Posted 26 Dec 2016 Link to this post

    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.
  3. Etienne
    Etienne avatar
    51 posts
    Member since:
    Sep 2014

    Posted 04 Jan Link to this post

    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

  4. Martin Ivanov
    Admin
    Martin Ivanov avatar
    1336 posts

    Posted 09 Jan Link to this post

    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.
Back to Top