Completed
Last Updated: 21 Jun 2018 14:39 by ADMIN
ADMIN
Dimitar
Created on: 07 Jun 2018 05:30
Category: Editors
Type: Bug Report
0
FIX. RadMaskedEditBox - invalid value when EnableNullValueInput is set to true
Use the following code:
public RadForm1()
{
    InitializeComponent();
    radMaskedEditBox1.MaskType = Telerik.WinControls.UI.MaskType.Numeric;
    radMaskedEditBox1.Mask = "d0";
    radMaskedEditBox1.EnableNullValueInput = true;

    radMaskedEditBox1.TextChanged += RadMaskedEditBox1_TextChanged;
    radMaskedEditBox1.ValueChanged += RadMaskedEditBox1_ValueChanged;

    radMaskedEditBox1.Value = null;

}

private void RadMaskedEditBox1_ValueChanged(object sender, EventArgs e)
{
    Console.WriteLine(radMaskedEditBox1.Value);
}

- Type "1", you will notice that the value is still null.
- Type "2", the value is now correct.

Workaround:
private void RadMaskedEditBox1_ValueChanged(object sender, EventArgs e)
{
    if (radMaskedEditBox1.Text != "" )
    {
        var provider = radMaskedEditBox1.MaskedEditBoxElement.Provider;
        Console.WriteLine(provider.Value);
    }
    else
    {
        Console.WriteLine(radMaskedEditBox1.Value);
    }
  
}
er.Value);
0 comments