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

Setting ButtonPartStyle in SplitButtonStyle make no effect

1 Answer 104 Views
ColorPicker
This is a migrated thread and some comments may be shown as answers.
Sergey
Top achievements
Rank 1
Sergey asked on 24 Apr 2014, 12:38 PM
Hello!

ColorButtonStyle is obsolete property. So I want to use SplitButtonStyle to customize ButtonPart.
When I apply SplitButtonStyle  to RadColorPicker it make no difference, but it is ok when I apply this style to SplitButton itself.
Control's version is 2014.1.224.40

Styles:

<Style TargetType="Button" x:Key="ColorButtonStyle">
     <Setter Property="Template">
         <Setter.Value>
             <ControlTemplate TargetType="Button">
                 <Grid Height="25" Background="Transparent">
                     <Grid.RowDefinitions>
                         <RowDefinition Height="0.664*" />
                         <RowDefinition Height="0.336*" />
                     </Grid.RowDefinitions>
                     <TextBlock Text="Y" HorizontalAlignment="Center" Foreground="Red" />
                     <Rectangle Width="16" Margin="-2 0 0 0" Fill="{TemplateBinding Background}" Height="4.232"
                             Grid.Row="1" VerticalAlignment="Top" />
                 </Grid>
             </ControlTemplate>
         </Setter.Value>
     </Setter>
     <Setter Property="Background" Value="Black" />
 </Style>
 
 <Style TargetType="telerik:RadSplitButton" x:Key="SplitButtonStyle">
    <Setter Property="ButtonPartStyle" Value="{StaticResource ColorButtonStyle}" />
</Style>

The way I use them:

<telerik:RadColorPicker SplitButtonStyle="{StaticResource SplitButtonStyle}"/>
 
<telerik:RadSplitButton Style="{StaticResource SplitButtonStyle}"/>





1 Answer, 1 is accepted

Sort by
0
Evgenia
Telerik team
answered on 29 Apr 2014, 09:09 AM
Hi Segey,

Unfortunately you hit a bug in RadColorPicker. From what I tested locally it seems that SplitButtonStyle property doesn't get applied and thus you can't modify the SplitButton this way. Our developers were notified and this will be fixed as soon as possible (for one of our upcomming internal builds released every Monday). An option would be to strip down the whole ColorPicker default template from our themes and modify whatever needed there. There is an article explaining this.

We apologize for the inconvenience. You may find your Telerik points updated as a sign of gratitude for pointing this out.

Regards,
Evgenia
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
ColorPicker
Asked by
Sergey
Top achievements
Rank 1
Answers by
Evgenia
Telerik team
Share this question
or