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

ColorBox Programmatically select Tab

2 Answers 126 Views
ColorBox
This is a migrated thread and some comments may be shown as answers.
pierre-jean
Top achievements
Rank 1
Veteran
Iron
pierre-jean asked on 19 Jun 2019, 05:26 PM

I wish to programmatically select the "Basic" Colors Tab when the colorbox is opened, without hidding the other tabs

Thanks in advance

2 Answers, 1 is accepted

Sort by
0
Nadya | Tech Support Engineer
Telerik team
answered on 21 Jun 2019, 02:07 PM
Hello, Pierre-Jean,

To achieve this result, you should first get access to RadColorDialogForm which represents a dialog containing a color picker. Note that the RadColorDialogForm uses a UserControl for the color selector. It is of type RadColorSelector and allows the access to ActiveMode property so you can set the desired color mode.

Please refer to the following code snippet which demonstrates how to access the RadColorDialogForm and show the "Basic" color mode when the color box is opened. 

public Form1()
{
    InitializeComponent();
 
    RadColorDialogForm colorForm = this.radColorBox1.ColorBoxElement.ColorDialog.ColorDialogForm as RadColorDialogForm;
    colorForm.Shown += colorForm_Shown;
}
private void colorForm_Shown(object sender, EventArgs e)
{
    RadColorDialogForm colorForm = sender as RadColorDialogForm;
    if (colorForm != null)
    {
        RadColorSelector selector = colorForm.RadColorSelector as RadColorSelector;
        selector.ActiveMode = Telerik.WinControls.ColorPickerActiveMode.Basic;
    }
}

I hope this information helps. Should you have any other questions, I will be glad to help.

Regards,
Nadya
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
pierre-jean
Top achievements
Rank 1
Veteran
Iron
answered on 21 Jun 2019, 03:27 PM

Thanks a lot
It works perfectly
Best Regards

Ian
Top achievements
Rank 2
Bronze
Iron
Iron
commented on 06 Oct 2022, 10:42 AM

I agree - good solution
Tags
ColorBox
Asked by
pierre-jean
Top achievements
Rank 1
Veteran
Iron
Answers by
Nadya | Tech Support Engineer
Telerik team
pierre-jean
Top achievements
Rank 1
Veteran
Iron
Share this question
or