When we use context menu of the control to paste text and the mask is not focused an ArgumentOutOfRangeException is thrown.
RadMaskedTextInput. Value is 12345. Select All. Then press "A" (or random key) while down, press space key and then release it (this happens when you type fast). Expected: Value is "A ". Actual Value is " " (A is removed). Workaround: public class CustomInput : RadMaskedTextInput { protected override void OnKeyDown(KeyEventArgs e) { if (this.Value != null && this.SelectionLength == this.Value.Length && this.SelectionLength > 0) { this.ClearCommand.Execute(null); } base.OnKeyDown(e); } }
Office 2016 Theme MaskedInputControl. IsReadOnly="True" IsClearButtonVisible="False" Space for clear button is reserved which is unexpected. Button should be hidden and no space should be reserved like in, for example Office_Black Theme.
Pressing backspace or delete keys produce wrong carret position in numeric input or currency input. For example Value is 1234 formatted like 1,234.0. Caret is between 2 and 3. Pressing backspace leads to 13|4. Expected is 1|34.
The SpinMode property is set to Position and the Mask is like "d" or "#". The "d" means that a digit pattern is required , "#" is for non-required digit. When the caret is on the empty placeholder and the Key.Up Arrow is pressed, non-numeric characters appear first ("! " then """ then "#" etc). The expected behavior is that only digits are looped in such mask *digit* positions.
The position of the caret is wrong when after selecting multiple chars then one of Backspace or Delete buttons is clicked. Example: Value is 123456 Formated it looks like : 123,456.00 Selected portion is [3,4]. Pressing backspace results in 125 | 6.00 Expected is 12|56.00/ Consider | as the caret position. The behavior can be observed in Numeric and Currency Inputs. Possible workaround: private void RadMaskedNumericInput_PreviewKeyDown(object sender, KeyEventArgs e) { var selectionstart = this.numericInput.SelectionStart + this.numericInput.SelectionLength; if (this.numericInput.SelectionLength > 0 && (e.Key == Key.Back || e.Key == Key.Delete)) this.numericInput.ValueChanged += (ss, ee) => { this.numericInput.SelectionStart = selectionstart; }; }
This is reproducible in a NoMask scenario.
The method should be called after the text that should be copied to the clipboard is extracted. In its original implementation it should only set the text to the clipboard. You should be able to override it and replace the text or use different method for copying into the clipboard. For example: public class CustomMaskedInputControl : RadMaskedDateTimeInput { protected override void SaveTextToClipboard(string text) { Clipboard.SetDataObject(text); } }
MaskedTextInput with Mask="(###)-###-####" and EmptyContent="Type digits" , type a single digit, for example 6 in the control. Value becomes 6 and Text becomes '(6__)-___-____'. Mask is changed runtime to empty string (runtime) and the focus is out of the MaskedInput the control. Value continues to be 6 but Text becomes '6' according to the new MASK. EmptyContent string is shown, although Text is 6. Expected: Text is shown in the control '6'. Same issue in NumericInput and CurrencyInput. ======================================= ======================================= The following workaround could be considered. public class CustomTextInput : RadMaskedTextInput { protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e) { if (e.Property.Name == "Mask") { if (e.NewValue.ToString() == string.Empty) { this.LiteralPositions.Clear(); } } base.OnPropertyChanged(e); } }
RadMaskedInput with NO-MASK (Mask="") and percentage P0 formatstring has some issues with typing digits. After clearing the value and typing digit, caret moves after the percentage sign and editing is not possible.
For example the following culture: this.currency.Culture = new System.Globalization.CultureInfo("prs-AF"); has this.currency.Culture.NumberFormat {System.Globalization.NumberFormatInfo} CurrencyDecimalDigits: 2 ===> CurrencyDecimalSeparator: "." ===> CurrencyGroupSeparator: "," CurrencyGroupSizes: {int[1]} CurrencyNegativePattern: 3 CurrencyPositivePattern: 0 CurrencySymbol: "؋" DigitSubstitution: NativeNational IsReadOnly: false NaNSymbol: "ناعدد" NativeDigits: {string[10]} NegativeInfinitySymbol: "-∞" NegativeSign: "-" NumberDecimalDigits: 2 ===> NumberDecimalSeparator: "," ===> NumberGroupSeparator: "." NumberGroupSizes: {int[1]} NumberNegativePattern: 3 PerMilleSymbol: "‰" PercentDecimalDigits: 2 PercentDecimalSeparator: "," PercentGroupSeparator: "." PercentGroupSizes: {int[1]} PercentNegativePattern: 1 PercentPositivePattern: 1 PercentSymbol: "%" PositiveInfinitySymbol: "∞" PositiveSign: "+" Typing 12345 in the control produces Value 123 which is wrong. Parsing becomes wrong after the group separator kicks in.
RadMaskedCurrencyInput with the following properties:
Mask="#14.2" , FormatString="#,0.##" and IsCurrencySymbolVisible= True
Pressing minus key produces ArgumentException
Message "String cannot be of zero length.\r\nParameter name: oldValue" string
at System.String.ReplaceInternal(String oldValue, String newValue)
at System.String.Replace(String oldValue, String newValue)
at Telerik.Windows.Controls.RadMaskedCurrencyInput.CoerceDisplayTextOverride()
at Telerik.Windows.Controls.RadMaskedInputBase.CoerceDisplayText()
at Telerik.Windows.Controls.RadMaskedInputBase.OnValueInternalChanged(DependencyObject d, DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
at Telerik.Windows.Controls.RadMaskedCurrencyInput.OnIsNegativeValueChanged()
at Telerik.Windows.Controls.RadMaskedCurrencyInput.set_IsNegativeValue(Boolean value)
at Telerik.Windows.Controls.RadMaskedCurrencyInput.ToggleNegativeSignKey()
This reproduces only in a no-mask scenario (Mask="").
For example, if you enter the codes for º and ª, they appears as 'o' and 'a'. In other words, the bigger version of the symbol.You have to add next features to RadMaskedNumericInput
- Data binding to object
- Value could be decimal
- Value range, from min to max,
so this control could be useful in complex data entry form.