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

Easily change the CloseButtonContainer Background

1 Answer 60 Views
DateTimePicker
This is a migrated thread and some comments may be shown as answers.
H.-G.
Top achievements
Rank 1
H.-G. asked on 01 Nov 2012, 11:33 AM
Is there a way to change the CloseButtonContainer.Background or the Background of the PART_Close ToggleButton without overwriting the whole template? We are using the Transparent Theme. I already changed the CalendarStyle and the ClockStyle to a usable Background color. But the Close-Button at the bottom is hardly visible. I don't want to put over 1500 extra lines of Template-Code to my Project. Unfortunately the PART_DropDownButton, CloseButtonContainer and the PART_Close Button itself are not accesible from a simple Style. I tried to set a Ressource to the DateTimePicker overwriting all RadToggleButtonStyles, but as seen in the Template the Part_Close Button uses its own Style and Template.

  <Style TargetType="telerik:RadCalendar" x:Key="CalendarBackStyle">
    <Setter Property="Background" Value="{StaticResource NormalToLightBackgroundBrush}" />
  </Style>
  
  <Style TargetType="telerik:RadClock" x:Key="ClockBackStyle">
    <Setter Property="Background" Value="{StaticResource NormalToLightBackgroundBrush}" />
  </Style>
  
  <Style TargetType="telerik:RadDateTimePicker">
    <Setter Property="CalendarStyle" Value="{StaticResource CalendarBackStyle}" />
    <Setter Property="ClockStyle" Value="{StaticResource ClockBackStyle}" />
  </Style>
  
<!--Overwrite Resources, didn't work-->
<telerik:RadDateTimePicker>
      <telerik:RadDateTimePicker.Resources>
           <Style TargetType="telerik:RadDropDownButton">
             <Setter Property="Background" Value="Lime" />
            </Style>
       </telerik:RadDateTimePicker.Resources>
</telerik:RadDateTimePicker>
 
<!--This works but doesn't help because all borders are styled-->
<telerik:RadDateTimePicker>
      <telerik:RadDateTimePicker.Resources>
           <Style TargetType="Border">
             <Setter Property="Background" Value="Lime" />
            </Style>
       </telerik:RadDateTimePicker.Resources>
</telerik:RadDateTimePicker>

Is there a simple solution?

1 Answer, 1 is accepted

Sort by
0
Masha
Telerik team
answered on 06 Nov 2012, 12:46 PM
Hi,

At the moment we do not have a separate style for CloseButtonContainer. The only way to modify it is to edit inside the template of RadDateTimePicker.

Greetings,
Maria
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
DateTimePicker
Asked by
H.-G.
Top achievements
Rank 1
Answers by
Masha
Telerik team
Share this question
or