Completed
Last Updated: 01 Jun 2018 11:57 by Dimitar
ADMIN
Hristo
Created on: 09 May 2018 14:59
Category: PropertyGrid
Type: Bug Report
0
FIX. RadPropertyGrid - unhandled exception in the control if you try to create a Font object with a negative size
How to reproduce: associate the control with an object having a Font property. It can be the form itself, then try and change the font-size, e.g: -1.

The standard property grid displays a message box with the error.

Workaround handle the RadPropertyGrid.EditorInitialized event:
private void RadPropertyGrid_EditorInitialized(object sender, PropertyGridItemEditorInitializedEventArgs e)
{
    PropertyGridSpinEditor editor = e.Editor as PropertyGridSpinEditor;
    if (editor != null && e.Item.Parent != null && e.Item.Parent.Name == "Font" && e.Item.Name == "Size")
    {
        editor.MinValue = 1;
    }
}

0 comments