Easily change the CloseButtonContainer Background

2 posts, 0 answers
  1. H.-G.
    H.-G. avatar
    6 posts
    Member since:
    Mar 2011

    Posted 01 Nov 2012 Link to this post

    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?
  2. Masha
    Admin
    Masha avatar
    355 posts

    Posted 06 Nov 2012 Link to this post

    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.

  3. UI for WPF is Visual Studio 2017 Ready
Back to Top