This is a migrated thread and some comments may be shown as answers.

Re-template control, loss radTickBar

1 Answer 67 Views
Slider
This is a migrated thread and some comments may be shown as answers.
Martin
Top achievements
Rank 1
Martin asked on 22 Jul 2013, 02:09 PM

hi

I used Blend 2012, when I retemplate the control (without doing anything to the generated style) i loss the top left radTickBar

attached image of it working, not working and code (not working but remove style={} and it works)

I am using 2012.3.1017.40

thanks
martin

     <telerik1:RadSlider Height="100"
   HandlesVisibility="Visible"
   TickPlacement="TopLeft"
   TickFrequency="1"
   IsSnapToTickEnabled="True"
   SelectionStart="0"  
   SelectionEnd="21"  
   MinimumRangeSpan="1"
   Minimum="0"
   SmallChange="1"
   LargeChange="1"
   Maximum="21"
   IsSelectionRangeEnabled="True" Style="{DynamicResource NotWorkingStyle}" >
   <telerik1:RadSlider.TickTemplate>
    <DataTemplate>
     <Grid>
      <TextBlock Text="{Binding}" FontSize="11"/>
     </Grid>
    </DataTemplate>
   </telerik1:RadSlider.TickTemplate>
  </telerik1:RadSlider>

1 Answer, 1 is accepted

Sort by
0
Accepted
Tina Stancheva
Telerik team
answered on 22 Jul 2013, 03:19 PM
Hi Martin,

Unfortunately Blend can't properly extract the ControlTemplate of the Slider and particularly it can't extract the default values of the ItemsSource proeprties of the two RadTickBars in teh ControlTemplate of the Slider.

We've looked into this but at this point we haven't found a solution. However, you can easily fix your style by adding the ItemsSource of the two RadTickBar controls defined in the RadSlider Template:
<!--  Set the ItemsSource property  -->
<telerik:RadTickBar x:Name="TopTickBar"
        Grid.Column="1"
        Grid.ColumnSpan="3"
        IsDirectionReversed="{TemplateBinding IsDirectionReversed}"
        ItemTemplate="{TemplateBinding TickTemplate}"
        ItemTemplateSelector="{TemplateBinding TickTemplateSelector}"
        ItemsSource="{TemplateBinding ResultTicks}"
        Maximum="{TemplateBinding Maximum}"
        Minimum="{TemplateBinding Minimum}"
        RenderTransformOrigin="0.5,0.5"
        Style="{TemplateBinding TickBarStyle}">
   ...
</telerik:RadTickBar>
...
<!--  If you want to display ticks at the bottom of the slider, you need to set the ItemsSource of this RadTickBar as well  -->
<telerik:RadTickBar x:Name="BottomTickBar"
    Grid.Row="2"
    Grid.Column="1"
    Grid.ColumnSpan="3"
    IsDirectionReversed="{TemplateBinding IsDirectionReversed}"
    ItemTemplate="{TemplateBinding TickTemplate}"
    ItemTemplateSelector="{TemplateBinding TickTemplateSelector}"
    ItemsSource="{TemplateBinding ResultTicks}"
    Maximum="{TemplateBinding Maximum}"
    Minimum="{TemplateBinding Minimum}"
    RenderTransformOrigin="0.5,0.5"
    Style="{TemplateBinding TickBarStyle}">
       ...
</telerik:RadTickBar>

For your convenience I also attached a sample solution where you can find the proper Template of the control.

Regards,
Tina Stancheva
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
Slider
Asked by
Martin
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Share this question
or