I have a RadMaskedEditBox with the MaskType set to "DateTime", the Mask set to "MM/dd/yyyy", TextMaskFormat set to "includeLiterals". This control is programmatically bound to an object in which the Date/Time value can be null. in the KeyDown event of the control, if the user presses the "DELETE" key and the selected text is the same as the text value and the selected text length is > 0, I clear the textbox using the "CLEAR()" method and then set the value to null.
However, the display value now changes to "01/01/0001".
What am I missing.
Here is my "KeyDown" event
private void radMaskedEditBoxDate_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyData == Keys.Delete)
{
RadMaskedEditBox radMaskedEditBox = (RadMaskedEditBox) sender;
if (radMaskedEditBox.SelectionLength > 0 && radMaskedEditBox.SelectedText == radMaskedEditBox.Text)
{
radMaskedEditBox.Clear();
//radMaskedEditBox.Value = null;
radMaskedEditBox.Value = radMaskedEditBox.NullText;
}
}
}