Completed
Last Updated: 23 Feb 2016 08:21 by ADMIN
ADMIN
Dess | Tech Support Engineer, Sr.
Created on: 24 Nov 2015 14:25
Category: PropertyGrid
Type: Bug Report
0
FIX. RadPropertyGrid - there is no indication that the property is modified when the DateTime value is cleared
To reproduce:

PropertyStoreItem prop1 = new PropertyStoreItem(typeof(DateTime), "Date", DateTime.Now);
PropertyStoreItem prop2 = new PropertyStoreItem(typeof(Nullable<DateTime>), "NullableDate", DateTime.Now);
PropertyStoreItem prop3 = new PropertyStoreItem(typeof(DateTime?), "Date?", DateTime.Now);

RadPropertyStore store = new RadPropertyStore();
store.Add(prop1);
store.Add(prop2);
store.Add(prop3); 
this.radPropertyGrid1.SelectedObject = store;

Open the editor for one of the properties and press the Clear button in the PropertyGridDateTimeEditor's popup. The value is cleared, but the PropertyValueButtonElement is not displayed.

Workaround: specify the initial value as default value for the property:

public Form1()
{
    InitializeComponent();

    DateTime initialValue = DateTime.Now;
    PropertyStoreItem prop1 = new PropertyStoreItem(typeof(DateTime), "Date", initialValue);
    prop1.Attributes.Add(new DefaultValueAttribute(initialValue));
    PropertyStoreItem prop2 = new PropertyStoreItem(typeof(Nullable<DateTime>), "NullableDate", initialValue);
    prop2.Attributes.Add(new DefaultValueAttribute(initialValue));
    PropertyStoreItem prop3 = new PropertyStoreItem(typeof(DateTime?), "Date?", initialValue);
    prop3.Attributes.Add(new DefaultValueAttribute(initialValue));
    
    RadPropertyStore store = new RadPropertyStore();
    store.Add(prop1);
    store.Add(prop2);
    store.Add(prop3); 
    this.radPropertyGrid1.SelectedObject = store;
     
}
Attached Files:
0 comments