Different Tooltips on range selector

3 posts, 1 answers
  1. Yoann
    Yoann avatar
    5 posts
    Member since:
    Jun 2015

    Posted 17 Jul 2015 Link to this post

    Is it possible to have 1 tooltip for the SelectionStart 'gripper' of the slider, and an other tooltip for the SelectionEnd 'gripper'?

     

  2. Answer
    Martin
    Admin
    Martin avatar
    1099 posts

    Posted 21 Jul 2015 Link to this post

    Hello Yoann,

    In order to achieve this you can use the ThumbStyle and AlternateThumbStyle properties of the RadSlider control. The properties accept a Style that targets a native Thumb element. However, by setting those styles you will override the default ones. So you can extract the default styles and use them as a base for the new one. Here is an example:
    <Style TargetType="Thumb" x:Key="ThumbStyle">           
        <!-- default setters -->
    </Style>
    <Style x:Key="leftThumbStyle" TargetType="Thumb" BasedOn="{StaticResource ThumbStyle}">
        <Setter Property="telerik:RadToolTipService.ToolTipContent" Value="Thumb 1" />
    </Style>
    <Style x:Key="rightThumbStyle" TargetType="Thumb" BasedOn="{StaticResource ThumbStyle}">
        <Setter Property="telerik:RadToolTipService.ToolTipContent" Value="Thumb 2" />
    </Style>
    <!-- ............ -->
    <telerik:RadSlider IsSelectionRangeEnabled="True" Minimum="0" Maximum="100"
                       ThumbStyle="{StaticResource leftThumbStyle}"
                       AlternateThumbStyle="{StaticResource rightThumbStyle}" />
    I also attached a project demonstrating this approach. I hope it is useful.

    Regards,
    Martin
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
  4. Yoann
    Yoann avatar
    5 posts
    Member since:
    Jun 2015

    Posted 22 Jul 2015 in reply to Martin Link to this post

    Thank you this is what I was looking for (although I was hoping for a solution which didn't require extracting the complete thumb style...)
Back to Top