Add a custom palette with its own name in a Telerik RadColorPicker

1 Answer 12 Views
ColorPicker
Serghei
Top achievements
Rank 1
Serghei asked on 29 Jul 2025, 08:09 AM | edited on 29 Jul 2025, 09:47 AM

Hello, I want to add a custom palette with its own names and colors in WPF. But seems like I can only work with built-in MainPalette, HeaderPalette, AdditionalContent

The image below shows my intention. I want to add not only 2 of them, but as many as I want.

1 Answer, 1 is accepted

Sort by
0
Stenly
Telerik team
answered on 29 Jul 2025, 01:22 PM

Hello Serghei,

To achieve this requirement, you could use the AddColorPaletteViews SDK example, which showcases how to display custom palettes. It can be found in our GitHub repository:

xaml-sdk/ColorPicker/AddColorPaletteViews at master · telerik/xaml-sdk

To hide the main, header, and standard palettes, as well as other elements, you could subscribe to the DropDownOpened event of RadColorPicker and retrieve them via the ChildrenOfType extension method as shown below:

private void colorPicker_DropDownOpened(object sender, Telerik.Windows.RadRoutedEventArgs e)
{
    Popup popUp = colorPicker.ChildrenOfType<Popup>().FirstOrDefault();

    RadColorPaletteView mainPalette = popUp.Child.ChildrenOfType<RadColorPaletteView>().FirstOrDefault(x => x.Name == "MainPalette");
    mainPalette.Visibility = Visibility.Collapsed;

    RadColorPaletteView headerPalette = popUp.Child.ChildrenOfType<RadColorPaletteView>().FirstOrDefault(x => x.Name == "HeaderPalette");
    headerPalette.Visibility = Visibility.Collapsed;

    RadColorPaletteView standardPalette = popUp.Child.ChildrenOfType<RadColorPaletteView>().FirstOrDefault(x => x.Name == "StandartPalette");
    standardPalette.Visibility = Visibility.Collapsed;

    TextBlock mainPaletteHeader = popUp.Child.ChildrenOfType<TextBlock>().FirstOrDefault(x => x.Name == "mainPaletteHeader");
    mainPaletteHeader.Visibility = Visibility.Collapsed;

    Border standardPaletteBorder = popUp.Child.ChildrenOfType<Border>().FirstOrDefault(x => x.Name == "StandardPaletteBorder");
    standardPaletteBorder.Visibility = Visibility.Collapsed;
}

The produced result when using the suggested SDK example and the above suggestion is as follows:

With this being said, could you give these suggestions a try?

Regards,
Stenly
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.

Serghei
Top achievements
Rank 1
commented on 29 Jul 2025, 02:01 PM

Hello Stenly. Thank you so much for the repsonse. Let me try then I'll provide the feedback
Stenly
Telerik team
commented on 30 Jul 2025, 09:58 AM

Hello Serghei,

Please take as much time as needed to test this suggestion.

Serghei
Top achievements
Rank 1
commented on 01 Aug 2025, 12:44 PM

Hello, I've tried. But it didn't work out for me, because the approach you suggested uses <telerik:RadColorPicker.AdditionalContent> AdditionalContent field, however, I need this field as well.  Maybe an onther approach can be applied? 

Anyway, I've solved my task by adding all my custom colors to the Main palette. That is not critical for me to split the colors, but would be nice.

Stenly
Telerik team
commented on 04 Aug 2025, 12:58 PM

Hello Serghei,

The default color palettes are defined in the default ControlTemplate of the RadColorSelector element, which is present in the default ControlTemplate of the RadColorPicker control.

With this in mind, an alternative approach would be to extract the default ControlTemplate of both of these elements and customize them to follow a similar approach to the AdditionalContent property. Unfortunately, we do not have such an example, however, the following article showcases how to locate and extract our default ControlTemplates in order to introduce such customizations:

Editing Control Templates - Telerik UI for WPF

Serghei
Top achievements
Rank 1
commented on 04 Aug 2025, 01:06 PM

Thnak you for your help, anyway, Stenly. 
Tags
ColorPicker
Asked by
Serghei
Top achievements
Rank 1
Answers by
Stenly
Telerik team
Share this question
or