Completed
Last Updated: 11 Jul 2016 12:16 by ADMIN
ADMIN
Dimitar
Created on: 26 Apr 2016 08:02
Category: Editors
Type: Bug Report
1
FIX. RadMaskedEditBox - the decimal key is not respected when the decimal separator is different then '.'
To reproduce:
Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("es-CO");
radMaskedEditBox1.MaskType = Telerik.WinControls.UI.MaskType.Numeric;
radMaskedEditBox1.Mask = "C2";
radMaskedEditBox1.Culture = new System.Globalization.CultureInfo("es-CO");

Click in the masked edit box and press the decimal separator key in the num pad, the cursor is not moved to the desired position.

Workaoround:
 private void RadMaskedEditBox1_KeyUp(object sender, KeyEventArgs e)
{
    if (e.KeyValue ==  46)
    {
        var textBoxItem = this.radMaskedEditBox1.MaskedEditBoxElement.TextBoxItem;

        int indexOfDecimalSeparator = this.radMaskedEditBox1.MaskedEditBoxElement.TextBoxItem.Text.ToLower().IndexOf(',');
        if (indexOfDecimalSeparator + 1 <= textBoxItem.Text.Length)
        {
            textBoxItem.SelectionStart = indexOfDecimalSeparator + 1;
        }
        else
        {
            textBoxItem.SelectionStart = indexOfDecimalSeparator;
        }
        e.Handled = true;
    }

}

(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
0 comments