Color Picker background color when expanded

0 Answers 63 Views
ColorPicker
Wael
Top achievements
Rank 1
Iron
Wael asked on 18 Sep 2023, 12:50 PM

how to change the background color of a color picker control when expanded (black theme) to a customized color ? 

 

 

Dinko
Telerik team
commented on 18 Sep 2023, 05:51 PM

Hello Wael,

I am not so sure what do you want to change in the RadDatePicker control. Do you want to change the background of the button or the drop-down's background color? If it is possible, can you give me more information about the desired result?

Wael
Top achievements
Rank 1
Iron
commented on 19 Sep 2023, 10:05 AM

Hi Dinko 

the point is to change both to the colours we want, i tried to edit template but unfortunately i am only allowed to submit a new one which is not what i want, 

as shown in the below screenshot i was partially able to change some but not the rest using below code

 


            ColorPicker.StandardPalette = ColorPreset.None;
            ColorPicker.StandardPaletteVisibility = Visibility.Collapsed;
            ColorPicker.StandardPaletteHeaderText = string.Empty;
            ColorPicker.HeaderPalette = ColorPreset.None;
            ColorPicker.HeaderPaletteVisibility = Visibility.Collapsed;
            ColorPicker.StandardPaletteHeaderText = string.Empty;
            ColorPicker.MainPaletteHeaderText = "Error color";
            ColorPicker.MainPaletteColumnsCount = 6;
            ColorPicker.MainPaletteItemsSource = StatusMonitorRSBViewModel.CustomPaletteColors;
            ColorPicker.AutomaticColor = ColorPicker.SelectedColor;

 

does it make sense now?

 

basically, i need to be able to edit the control template

 

Dinko
Telerik team
commented on 20 Sep 2023, 03:10 PM

Hi Wael,

To change the RadColorPicker's dropdown menu color, you can set a Style with TargetType="RadColorSelector" to its ColorSelectorStyle property. In this Style, set the Background property to the desired value:

<telerik:RadColorPicker.ColorSelectorStyle>
    <Style TargetType="telerik:RadColorSelector">
        <Setter Property="Background" Value="Green"/>
    </Style>
</telerik:RadColorPicker.ColorSelectorStyle>

This will produce the following result when the Offce_Black theme is applied to the RadColorPicker control:

To change the color of the RadColorPicker part (not the dropdown menu part) when it is expanded, the default ControlTemplate would have to be edited. Before continuing further, could you share, which theme is used on your end? This way, I can suggest, which parts of the default ControlTemplate to modify, in order to achieve the desired functionality.

On a side note, we have an article that shows how to extract and modify the default ControlTemplates of our controls. It can be found at the following link:

Editing Control Templates | Telerik UI for WPF

Regards,
Dinko
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

No answers yet. Maybe you can help?

Tags
ColorPicker
Asked by
Wael
Top achievements
Rank 1
Iron
Share this question
or