Completed
Last Updated: 31 Jan 2024 11:39 by ADMIN
Release 2024 Q1 (2024.1.130)
Al
Created on: 22 Nov 2023 14:15
Category: PropertyGrid
Type: Bug Report
0
RadPropertyGrid: Incorrect behavior for PropertyGridSpinEditor if you select more that one object
select two items in the grid, click on the ValueI in the MS GridView then press ESC and click again on ValueI: the cell is always empty.
Do the same thing in your RadPropertyGrid. The first time you get 0, the second time -2147483648.
1 comment
ADMIN
Nadya | Tech Support Engineer
Posted on: 22 Nov 2023 14:34

Hello, Al,

To workaround this behavior you can use the following custom MyPropertyGridSpinEditor:

private void RadPropertyGrid_EditorRequired(object sender, PropertyGridEditorRequiredEventArgs e)
{
    if (e.EditorType == typeof(PropertyGridSpinEditor))
    {
        e.Editor = new MyPropertyGridSpinEditor();
    }
}

public class MyPropertyGridSpinEditor : PropertyGridSpinEditor
{
    public override object Value
    {
        get { return base.Value; }
        set 
        {
            RadSpinElement spinEditor = (RadSpinElement)this.EditorElement;
            if (value == null)
            {
                spinEditor.EnableNullValueInput = true;
            }
            else 
            {
                spinEditor.EnableNullValueInput = false;
            }

            base.Value = value;
        }
    }
}

Regards,
Nadya | Tech Support Engineer
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Attached Files: