Completed
Last Updated: 19 Jul 2018 08:15 by Dimitar
ADMIN
Dimitar
Created on: 18 Jul 2018 09:13
Category: Editors
Type: Bug Report
0
FIX. RadDateTimePicker - the Value cannot be changed with the up/down arrow after ValueChanging event is canceled
To reproduce:

Add the following code:
int count = 0;
private void dateTimePicker1_ValueChanging(object sender, Telerik.WinControls.UI.ValueChangingEventArgs e)
{
   
    if (count == 2)
    {
        e.Cancel = true;
    }
    count++;
}

- Select the year and press down multiple times. After some time the event is not fired any more. 

Workaround:
class MyMaskDateTimeRpovider : MaskDateTimeProvider
{
    public MyMaskDateTimeRpovider(string mask, CultureInfo culture, RadMaskedEditBoxElement owner) : base(mask, culture, owner)
    { }
    public override object Value
    {
        get { return base.Value; }
        set
        {
            typeof(MaskDateTimeProvider).GetField("oldValue", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(this, null);
            base.Value = value;
        }
    }

}
0 comments