Problem with TickTemplate in RadSlider

4 posts, 1 answers
  1. hwsoderlund
    hwsoderlund avatar
    419 posts
    Member since:
    Aug 2006

    Posted 23 Jul 2008 Link to this post

    I've been trying to set the TickTemplate of the RadSlider component like the following:

    1 <telerikbase:RadSlider  
    2     TickTemplate="{StaticResource RadTickTemplate}" 
    3     Ticks="{Binding CustomDataPredefinedValues}" 
    4     TickPlacement="TopLeft"  
    5     TickFrequency="1"  
    6     IsSnapToTickEnabled="True" 
    7     IsMoveToPointEnabled="True" 
    8     SmallChange="1" LargeChange="1"
    9 </telerikbase:RadSlider> 

    And then, in the resources:
    1 <DataTemplate x:Key="RadTickTemplate"
    2     <Rectangle Width="5" Height="6" Fill="Black"></Rectangle> 
    3 </DataTemplate> 

    However, this doesn't appear to work. I finally got it working by using the TickTemplateSelector, like in the sample application, but that seems far from ideal. Is this a known bug, or am I doing something wrong?
  2. hwsoderlund
    hwsoderlund avatar
    419 posts
    Member since:
    Aug 2006

    Posted 23 Jul 2008 Link to this post

    Just to clarify: Nothing crashes with the above code. The template just doesn't appear.
  3. DevCraft banner
  4. Answer
    Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1512 posts

    Posted 23 Jul 2008 Link to this post

    Hi Henrik,

    I was not able to reproduce the problem you are experiencing. Please take a look at the sample project that I have attached and tell me whether it is like yours. I used the latest assemblies of RadControls for Silverlight 2, which will be officially available for download after several hours and it is possible that you struggle with a bug which has been already fixed.

    In the project I have a simple class with a CustomDataPredefinedValues property that is of type DoubleCollection. In the Page constructor I create an instance of the class and populate its CustomDataPredefinedValues property with double values. At the end, the class is given as DataContext to the Page.

    If you experience any additional problems, please, do not hesitate to contact us.

    Greetings,
    Kiril
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  5. hwsoderlund
    hwsoderlund avatar
    419 posts
    Member since:
    Aug 2006

    Posted 23 Jul 2008 Link to this post

    Yes, it's exactly the same. Your example didn't include the updated assembly, so I compiled it against my version, and it shows nothing for the ticks. So if it's working on your machine I'm confident it will work when the update is released. Thank you for your help.
Back to Top