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

How to pre-define colors into RadColorDialog?

1 Answer 24 Views
ColorDialog
This is a migrated thread and some comments may be shown as answers.
georgi
Top achievements
Rank 1
georgi asked on 25 Apr 2016, 07:01 AM

Hi,

based on our corporate identity, we want to use specific set of colors only. Is there any possibility to pre-define our company colors into RadColorDialog. pickers?

thanks

Georgi

1 Answer, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 26 Apr 2016, 05:31 PM
Hello Georgi,

Thank you for writing.

The form used by the RadColorDialog control exposes several properties with which you define which tabs will be visible. Please check the following documentation resource discussing these properties: RadColorDialog | Getting Started.

You can also access the RadPageView and add a new page to it, which can host a user control populated with colors as per your requirement. Please check my code snippet below: 
public Form1()
{
    InitializeComponent();
 
    this.radColorDialog1.ColorDialogForm.ShowBasicColors = false;
    this.radColorDialog1.ColorDialogForm.ShowCustomColors= false;
    this.radColorDialog1.ColorDialogForm.ShowProfessionalColors = false;
    this.radColorDialog1.ColorDialogForm.ShowSystemColors = false;
 
    ((RadColorDialogForm)this.radColorDialog1.ColorDialogForm).FormClosing += ColorDialogForm_FormClosing;
    RadPageView pageView = ((RadColorDialogForm)this.radColorDialog1.ColorDialogForm).RadColorSelector.Controls["radPageView1"] as RadPageView;
 
    RadPageViewPage corporatePage = new RadPageViewPage() { Text = "Corporate" };
    pageView.Pages.Add(corporatePage);
}
 
private void ColorDialogForm_FormClosing(object sender, FormClosingEventArgs e)
{
    // Read the selected corporate color.
}

I hope this helps. Please let me know if you need further assistance.

Regards,
Hristo Merdjanov
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
ColorDialog
Asked by
georgi
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Share this question
or