slider Template issue

2 posts, 1 answers
  1. dCODE
    dCODE avatar
    18 posts
    Member since:
    Jan 2010

    Posted 23 Feb 2010 Link to this post


     i need to create make my slider dynamic. so i need to change my maximum value for each 5 mins, so am trying to  bind my maximum and minimum value(DateTime) from database. here am facing problem,that i cannot bind the values in minimum,maximum and in the textblock, i cant even call the biniding function here, please tel me how to call and bind my values to the slider




    telerik:RadSlider Minimum="{Binding {StaticResource MinValue}}" Maximum="{Binding {StaticResource MaxValue}}" TickFrequency="1" TickPlacement="BottomRight" IsSnapToTickEnabled="True" Margin="133,175,114,204">




























    <Ellipse Width="5" Height="5" Fill="Black" HorizontalAlignment="Center"/>




    <TextBlock Text="{Binding}" FontSize="10"/>






























  2. Answer
    Kiril Stanoev
    Kiril Stanoev avatar
    1508 posts

    Posted 25 Feb 2010 Link to this post

    Hi dCODE,

    The Maximum and Minimum values of RadSlider are of type double. Therefore, if MinValue and MaxValue are of type DateTime, you will need to use a converter to pass a valid double value when binding.
    The way RadSlider works is that the data context of each tick is the value at the corresponding position. Therefore, if you want to convert the double value to a DateTime and show it in the TextBox, you will have to use another converter. I have attached a sample project demonstrating this functionality. Currently, when using a Converter in the TickTemplate causes the RadSlider to not measure its ticks properly. This limitation will be fixed for our official release, which is scheduled for the mid of March. Have a look at it and let me know if you have additional questions or comments on the topic.

    Best wishes,
    Kiril Stanoev
    the Telerik team

    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 Public Issue Tracking system and vote to affect the priority of the items.
  3. DevCraft R3 2016 release webinar banner
Back to Top