Use attached to reproduce. 1 - In the First Text Box (the Masked Box) type 1 2 - Click the "GO" button. The text box shows 1 and the VALUE is displayed from the Edit box correctly as 1 3 - Select the 1 in the edit box and CTRL + DELETE to clear the field 4 - Click the "GO" button. The text box shows NULL and the VALUE is displayed from the Edit box correctly as NULL 5 - Highlight the text in the "Paste Me!" text box and Copy the text to Clipboard. 6 - Paste the clipboard into the Masked t Edit box 7 - Click "GO". The mask text box correctly displayed NULL however the returned VALUE is 1
To reproduce: Add the following code: int count = 0; private void dateTimePicker1_ValueChanging(object sender, Telerik.WinControls.UI.ValueChangingEventArgs e) { if (count == 2) { e.Cancel = true; } count++; } - Select the year and press down multiple times. After some time the event is not fired any more. Workaround: class MyMaskDateTimeRpovider : MaskDateTimeProvider { public MyMaskDateTimeRpovider(string mask, CultureInfo culture, RadMaskedEditBoxElement owner) : base(mask, culture, owner) { } public override object Value { get { return base.Value; } set { typeof(MaskDateTimeProvider).GetField("oldValue", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(this, null); base.Value = value; } } }
To reproduce: - Use the Fluent theme with RadSpinEditor on a HDPI monitor. Workaround: var borderPrimitive = radSpinEditor1.SpinElement.Children[1] as BorderPrimitive; borderPrimitive.BottomWidth = 2;
To reproduce: this.radBrowseEditor1.Value = @"D:\Projects"; this.radBrowseEditor1.ReadOnly = false; this.radBrowseEditor1.BrowseElement.ShowClearButton = true; You will notice that the clear button is not shown. Workaround: LightVisualButtonElement btn = new LightVisualButtonElement(); btn.Text = "X"; btn.Click += btn_Click; btn.StretchHorizontally = false; this.radBrowseEditor1.BrowseElement.BrowseButton.Parent.Children.Add(btn); private void btn_Click(object sender, EventArgs e) { this.radBrowseEditor1.Value = null; }
See attached video to reproduce.
To reproduce: - Set the DropDownSizingMode to None - Show the popup several times. - Each time the height is increased. Workaround: var popup = radPopupEditor1.PopupEditorElement.PopupForm as RadPopupContainerForm; popup.SizingGrip.MinSize = new Size(0, 0);
How to reproduce: The spell checker`s AutoSpellCheckControl property must not be set. Add a ContextMenuStrip with several items and use it with a standard text box. Then perform a spell check with the RadSpellChecker control, e.g. like this: Me.RadSpellChecker1.Check(Me.TextBox1) Then right-click in the text box, the context menu will not be shown. Workaround: use RadContextMenu https://docs.telerik.com/devtools/winforms/menus/contextmenu/context-menus
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);
To reproduce: Me.RadDateTimePicker2.Format = DateTimePickerFormat.Custom Me.RadDateTimePicker2.CustomFormat = "hh:mm tt" Select the hours part with the mouse, the selection is affected correctly. Select the minutes part, the selection is affected correctly. Select the AM/PM part, the selection is again affected correctly. Now, try to select again the minutes part. You will notice that the cursor is affected correctly but the selection is missing. Once you select the AM/PM part then the selection is not updated properly with the mouse anymore. Workaround: Me.RadDateTimePicker1.DateTimePickerElement.TextBoxElement.Provider = New CustomMaskDateTimeProvider(Me.RadDateTimePicker2.DateTimePickerElement.TextBoxElement.Mask, Me.RadDateTimePicker2.Culture, Me.RadDateTimePicker2.DateTimePickerElement.TextBoxElement) Public Class CustomMaskDateTimeProvider Inherits MaskDateTimeProvider Public Sub New(mask As String, culture As CultureInfo, owner As RadMaskedEditBoxElement) MyBase.New(mask, culture, owner) End Sub Public Overrides Function SelectCurrentItemFromCurrentCaret() As Boolean Dim currentSelection As Integer = Me.TextBoxItem.SelectionStart Dim currentPos As Integer = 0 Dim selected As Boolean = False 'If Me.List(Me.SelectedItemIndex).type = PartTypes.AmPm Then ' Return True 'End If For i As Integer = 0 To Me.List.Count - 1 Dim part As MaskPart = Me.List(i) If SelectMilliseconds(i, part) Then Exit For End If If currentSelection >= part.offset AndAlso currentSelection <= part.offset + part.len AndAlso Not part.[readOnly] AndAlso part.type <> PartTypes.Character Then Me.TextBoxItem.SelectionStart = Me.List(i).offset Me.TextBoxItem.SelectionLength = Me.List(i).len Me.SelectedItemIndex = i selected = True Exit For End If currentPos += part.len Next Return selected End Function Private Function SelectMilliseconds(ByVal i As Integer, ByVal part As MaskPart) As Boolean If part.type = PartTypes.MiliSeconds AndAlso Me.value.Millisecond Mod 10 = 0 AndAlso part.trimsZeros Then Dim newLen As Integer = part.len For power As Integer = 1 To part.len If Me.value.Millisecond Mod Math.Pow(10, power) = 0 Then newLen -= 1 Else Exit For End If Next Me.textBoxItem.SelectionStart = Me.list(i).offset Me.textBoxItem.SelectionLength = newLen Me.SelectedItemIndex = i Return True End If Return False End Function End Class
https://msdn.microsoft.com/en-us/library/system.windows.forms.maskedtextbox.maskcompleted(v=vs.110).aspx
To reproduce: - Open the attached project. - Click the day part and press N - Click the hour part and press N - PM is changed to AM Workaround: public RadForm1() { InitializeComponent(); radDateTimePicker1.Format = DateTimePickerFormat.Custom; radDateTimePicker1.CustomFormat = @"yyyy/MM/dd hh:mm:ss tt"; radDateTimePicker1.DateTimePickerElement.TextBoxElement.TextBoxItem.KeyPress += TextBoxItem_KeyPress; } private void TextBoxItem_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 'n') { e.Handled = true; radDateTimePicker1.Value = DateTime.Now; } }
We should also add padding to the RadTimePicker Workaround: this.radSpinEditor1.SpinElement.Padding = new Padding(2, 0, 0, 0); this.radTimePicker1.TimePickerElement.Padding = new Padding(2, 0, 0, 0);
To reproduce: - Open the demo application. - Open the PropertyGrid -> FirstLook example. - Open the color dialog editor multiple times.
Use attached to reproduce. - Open the dialog multiple times.
To reproduce: set this.radMaskedEditBox1.MaskType = Telerik.WinControls.UI.MaskType.IP; and try to enter '300' for the first part of the IP address. A message pops up explaining that the value is outside the valid range. This message can't be changed. It should allow localizing. In addition, a RadMessageBox should be shown as well.
Use attached to reproduce. Workaround: Use RadTextBox.
To reproduce: Me.RadDateTimePicker1.Format = DateTimePickerFormat.Custom Me.RadDateTimePicker1.CustomFormat = "MM/dd/yyyy" Dim provider As MaskDateTimeProvider = TryCast(Me.RadDateTimePicker1.DateTimePickerElement.TextBoxElement.Provider, MaskDateTimeProvider) provider.AutoSelectNextPart = True If you type in 01/01/50, RadDateTimePicker displays 01/01/1950 which is correct. If you type in 01/01/2050, the system is again changing the century and display 01/01/1950 which is incorrect. Workaround: use a custom mask provider to customize how the autocompletion work: Public Class CustomMaskDateTimeProvider Inherits Telerik.WinControls.UI.MaskDateTimeProvider Public Sub New(mask As String, culture As CultureInfo, owner As RadMaskedEditBoxElement) MyBase.New(mask, culture, owner) End Sub Protected Overrides Function HandleKeyPress(part As MaskPart, e As KeyPressEventArgs) As Boolean Dim value As Integer = 0 If Not Integer.TryParse(e.KeyChar.ToString(), value) Then Return True End If Dim stringValue As String = String.Empty If part.type = PartTypes.MiliSeconds Then Dim newValue As Integer = CInt((part.value / Math.Pow(10, (3 - part.len)))) * 10 + value part.value = newValue Mod CInt(Math.Pow(10, part.len)) Else stringValue = part.value.ToString() If stringValue.Length = part.len AndAlso stringValue.Length >= part.maskPart.Length Then stringValue = stringValue.Substring(1) End If If Me.AutoCompleteYear AndAlso stringValue.Length = 1 Then stringValue = String.Empty End If part.value = Integer.Parse(stringValue & e.KeyChar) End If If part.type = PartTypes.Year AndAlso part.maskPart.Length = 2 Then Dim len As Integer = part.value.ToString().Length part.value = Integer.Parse(String.Format("{0}{1}", DateTime.Now.Year.ToString().Substring(0, 2), part.value.ToString().Substring(len - 2, 2))) End If If Me.AutoCompleteYear AndAlso part.type = PartTypes.Year Then Dim len As Integer = part.value.ToString().Length If len >= 2 Then part.value = Integer.Parse(part.value.ToString().Substring(len - 2, 2)) End If 'If part.value >= 50 AndAlso part.value <= 99 Then ' part.value += 1900 'ElseIf part.value >= 500 AndAlso part.value <= 999 Then ' part.value += 1000 'ElseIf part.value < 50 OrElse (part.value > 99 AndAlso part.value < 500) Then part.value += 2000 ' End If End If If part.value > part.max OrElse part.value < part.min Then part.value = value End If Return True End Function End Class Me.RadDateTimePicker1.Format = DateTimePickerFormat.Custom Me.RadDateTimePicker1.CustomFormat = "MM/dd/yyyy" Me.RadDateTimePicker1.DateTimePickerElement.TextBoxElement.Provider = New CustomMaskDateTimeProvider(Me.RadDateTimePicker1.DateTimePickerElement.TextBoxElement.Mask, Me.RadDateTimePicker1.Culture, Me.RadDateTimePicker1.DateTimePickerElement.TextBoxElement) Dim provider As MaskDateTimeProvider = TryCast(Me.RadDateTimePicker1.DateTimePickerElement.TextBoxElement.Provider, MaskDateTimeProvider) provider.MaxDate = Me.RadDateTimePicker1.DateTimePickerElement.MaxDate provider.AutoSelectNextPart = True provider.AutoCompleteYear = True Thus, the year always be 2000+.
Use attached to reproduce: - Disable and then enable the RadSateTimePicker - You will notice that even the checkbox is unchecked the control is enabled. Workaround: radDateTimePicker1.Enabled =true; if (!radDateTimePicker1.DateTimePickerElement.Checked) { radDateTimePicker1.DateTimePickerElement.TextBoxElement.TextBoxItem.HostedControl.Enabled = false; }
To reproduce: this.radDateTimePicker1.DateTimePickerElement.TextBoxElement.MaskType = MaskType.FreeFormDateTime; And try pasting a date, or some free text.
To reproduce: this.radTextBox1.NullText = "text"; this.radTextBox1.TextBoxElement.TextBoxItem.NullTextColor = Color.Red; Workaround: this.radTextBox1.TextBoxElement.NullTextColor = Color.Red;