Completed
Last Updated: 08 Nov 2016 14:44 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 30 May 2016 13:54
Category: Editors
Type: Bug Report
0
FIX. RadColorDialog - FormatException when clearing the value for one of the RGB components
To reproduce: please refer to the attached gif file.

The error is applicable for all controls that use RadColorDialog while editing, e.g. RadGridView, RadPropertyGrid. 

Workaround: disable the spineditors:

private void RadPropertyGrid1_EditorInitialized(object sender, Telerik.WinControls.UI.PropertyGridItemEditorInitializedEventArgs e)
{
    PropertyGridColorEditor colorEditor = e.Editor as PropertyGridColorEditor;
    if (colorEditor !=null)
    {
        RadColorBoxElement el = colorEditor.EditorElement as RadColorBoxElement;
        ((RadForm)el.ColorDialog.ColorDialogForm).Load += ColorDialogForm_Load1;
    }
}

private void ColorDialogForm_Load1(object sender, EventArgs e)
{
    RadColorDialogForm form = sender as RadColorDialogForm;
    RadPageView pageView = form.RadColorSelector.Controls["radPageView1"] as RadPageView;
    Telerik.WinControls.UI.RadColorPicker.ProfessionalColors professionalColors = 
        pageView.Pages[3].Controls["professionalColorsControl"] as Telerik.WinControls.UI.RadColorPicker.ProfessionalColors;
    foreach (Control c in professionalColors.Controls )
    {
        RadSpinEditor spinEditor = c as RadSpinEditor;
        if (spinEditor!=null)
        {
            spinEditor.SpinElement.TextBoxItem.Enabled = false;
        }
    }
}
Attached Files:
0 comments