Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > Slider > slider Template issue

Answered slider Template issue

Feed from this thread
  • dCODE avatar

    Posted on Feb 23, 2010 (permalink)

    Hi

     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">

     

     

     

     

     

     

     

    <telerik:RadSlider.TickTemplate>

     

     

     

     

     

     

     

    <DataTemplate>

     

     

     

     

     

     

     

    <StackPanel>

     

     

     

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

     

     

     

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

     

     

     

    </StackPanel>

     

     

     

     

     

     

     

    </DataTemplate>

     

     

     

     

     

     

     

    </telerik:RadSlider.TickTemplate>

     

     

     

     

     

     

     

    </telerik:RadSlider>

     

    Reply

  • Answer Kiril Stanoev Kiril Stanoev avatar

    Posted on Feb 25, 2010 (permalink)

    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.
    Attached files

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > Slider > slider Template issue
Related resources for "slider Template issue"

WPF Slider Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]