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); } }
This is reproducible in a NoMask scenario.
This leads to a wrong value displayed in the masked input. The mask is always coerced to "hh:mm:ss.ff". An additional, 'f' is added to the mask. Probably, this will happen also if you have a single letter on another position in the mask. To work this around you can create a custom masked input control and override its CoerceTextOverride() method. There you can implement some logic that replaces the wrong milliseconds text. Here is an example in code: public class CustomMaskedDateTimeInput : RadMaskedDateTimeInput { protected override string CoerceTextOverride(ref int selectionStart) { var text = base.CoerceTextOverride(ref selectionStart); if (this.Value.HasValue && this.Mask != null && this.Mask.Contains("hh:mm:ss.f")) { int millisecondsAllowedLength = GetAllowedMillisecondsLength(this.Mask); // example: .ff means that there are 2 allowed millisecond chars int millisecondsMaxLength = 3; // max = 999 var milliseconds = this.Value.Value.Millisecond.ToString(); // the original milliseconds give from the value var zeroesCount = millisecondsMaxLength - milliseconds.Length; // how many zeroes should be append before the millseconds string value milliseconds = new string('0', zeroesCount) + milliseconds; // append the zeroes // apply the milliseconds restriction given by the Mask (.ff - two symbols) if (milliseconds.Length > millisecondsAllowedLength) { int charsToRemoveCount = milliseconds.Length - millisecondsAllowedLength; for (int i = 0; i < charsToRemoveCount; i++) { milliseconds = milliseconds.Remove(milliseconds.Length - 1, 1); } } // replace the default parsed millseconds part of the string with the custom milliseconds var millisecondsIndex = text.LastIndexOf(".") + 1; text = text.Remove(millisecondsIndex, millisecondsMaxLength - millisecondsAllowedLength); text = text.Insert(millisecondsIndex, milliseconds); } return text; } private int GetAllowedMillisecondsLength(string mask) { int length = 0; var millisecondsIndex = mask.LastIndexOf(".") + 1; if (millisecondsIndex != -1) { length = mask.Length - millisecondsIndex; } return length; } }
For example, the Mask "hh:mm:ss.ff" will render the value properly. But if you change the value at runtime (by pressing a key on the keyboard), the milliseconds will be re-parsed and will be displayed wrongly. For example, if you have the value "12:13:14.50" and you go to the ".50" part (between the decimal separator and the number 5). And then press 3, the milliseconds will change to ".03". To work this around you can create a custom masked input control and override its CoerceTextOverride() method. There you can implement some logic that replaces the wrong milliseconds text. Here is an example in code: public class CustomMaskedDateTimeInput : RadMaskedDateTimeInput { protected override string CoerceTextOverride(ref int selectionStart) { var text = base.CoerceTextOverride(ref selectionStart); if (this.Value.HasValue && this.Mask != null && this.Mask.Contains("hh:mm:ss.f")) { int millisecondsAllowedLength = GetAllowedMillisecondsLength(this.Mask); // example: .ff means that there are 2 allowed millisecond chars int millisecondsMaxLength = 3; // max = 999 var milliseconds = this.Value.Value.Millisecond.ToString(); // the original milliseconds give from the value var zeroesCount = millisecondsMaxLength - milliseconds.Length; // how many zeroes should be append before the millseconds string value milliseconds = new string('0', zeroesCount) + milliseconds; // append the zeroes // apply the milliseconds restriction given by the Mask (.ff - two symbols) if (milliseconds.Length > millisecondsAllowedLength) { int charsToRemoveCount = milliseconds.Length - millisecondsAllowedLength; for (int i = 0; i < charsToRemoveCount; i++) { milliseconds = milliseconds.Remove(milliseconds.Length - 1, 1); } } // replace the default parsed millseconds part of the string with the custom milliseconds var millisecondsIndex = text.LastIndexOf(".") + 1; text = text.Remove(millisecondsIndex, millisecondsMaxLength - millisecondsAllowedLength); text = text.Insert(millisecondsIndex, milliseconds); } return text; } private int GetAllowedMillisecondsLength(string mask) { int length = 0; var millisecondsIndex = mask.LastIndexOf(".") + 1; if (millisecondsIndex != -1) { length = mask.Length - millisecondsIndex; } return length; } }
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.
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.
When we use context menu of the control to paste text and the mask is not focused an ArgumentOutOfRangeException is thrown.
Mask is like "##--##". Current Value is "1234" and you see "12--34" Caret is between 2 and "-". Pressing 3 wiill not move the caret after the digit 3. InputBehavior is set to "Replace"
A possible workaround is to subscribe to the PreviewKeyDown event of the mask then check if the back key is pressed and the whole text is select and set the value to null in order to erase the text of the mask. private void maskTextInput_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Back && this.maskTextInput.SelectionLength == this.maskTextInput.Text.Length) { this.maskTextInput.Value = null; } }
Possible workaround: You can subscribe to the PreviewTextInput event of the control and change the position of the caret if the typed char is the same as the current one. private void RadMaskedTextInput_PreviewTextInput(object sender, TextCompositionEventArgs e) { var input = sender as RadMaskedTextInput; var currentPosition = input.SelectionStart; if (currentPosition != input.Text.Length) { var currentChar = input.Text[currentPosition]; if (currentChar != input.Placeholder && currentChar.ToString() == e.Text) { input.SelectionStart++; } } } Available in R3 2016 Release
You have the following scenario. The UpdateValueEvent property is set to "LostFocus" and set no mask ( Mask= ""). When the input box is focused, press the minus sign key. You can see the that the minus is showing as expected. Then press a number and the "-" (minus) disappear. By pressing number key again the minus appears again. A workaround: Setting the UpdateValueEvent property to PropertyChanged Available in R2 2016 SP
You have the following scenario: The UpdateValueEvent property is set to "LostFocus". You have bound the Value property of the control to a property from your ViewModel. When this property is changed programmatically from negative to positive several times, the Value property of the control isn't updated correctly. It stays negative when it must stay positive. Workaround (if applicable): You can change the UpdateValueEvent property to "PropertyChanged" Other Possible workaround (if the bound property is named "Sum") private void radMaskedNumericInputSum_ValueChanging_1(object sender, Telerik.Windows.Controls.MaskedInput.RadMaskedInputValueChangingEventArgs e) { if (this.Sum != (double)e.NewValue) { e.Handled = true; } }
In order to reproduce, you need to focus the control when you run the application. 1.When you press the backspace key it removes the last character and after pressing it a second time the character will be replaced with the removed character. 2. When paste(Ctrl+V) a text in the control, the text is ignoring the current position of the caret and position at the beginning of the control.
Mask="" (no-mask) and FormatStyring =n3 or n4 , n5. Value is 0. Typing 0 then ".", then 0, then 0, then 5 produces 0.5000 but it should produce 0.0050. Fix available in LIB Version 2016.1.404.
Available in LIB version: 2016.3.1010
RadGridView with CellEditTemplate with RadMaskedDateTimeInput. Select a GridViewRow. Press ALT + N Key (or other key with letter/digit). Argument Exception occurs in MaskedDateTimeGridViewEditor. The issue is reproducible in Q3 2015 SP (1104) version of Telerik UI for WPF. The fix will be available in Q1 2016 Release.
Mask="Pddd" should disallow letters. However, after select all, you can type letter in the position of the first "d" Available in LIB Version: 2016.1.125.
Bug details: OS: Windows 10. VS: 2015 professional Telerik version: 2015.2 SP1 Code sample: <Window x:Class="RadMaskedInputBug.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" Title="MainWindow"> <Grid> <telerik:RadTextTimeInput /> </Grid> </Window> The designer crashes and shows only the exception: InvalidOperationException: Can only base on a Style with target type that is base type 'RadMaskedTextInput'. UPDATE: Telerik has submitted a bug report to Microsoft. You can check its progress here: https://connect.microsoft.com/VisualStudio/feedback/details/2005303/designer-error-can-only-base-on-a-style-with-target-type-that-is-base-type-customcontrol-when-a-style-is-basedon-a-style-of-an-abstract-class On 21/12/2015 Microsoft commented that a fix has been submitted and will be available in the next update.