How to pre-define colors into RadColorDialog?

2 posts, 0 answers
  1. georgi
    georgi avatar
    2 posts
    Member since:
    Nov 2013

    Posted 25 Apr Link to this post

    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

  2. Hristo Merdjanov
    Admin
    Hristo Merdjanov avatar
    710 posts

    Posted 26 Apr Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top