Workaround: this.radTextBox1.TextBoxElement.Fill.BackColor = backColor; this.radTextBox1.TextBoxElement.BackColor = backColor;
To reproduce: - Set the mask to IP. - Change the culture to German. Workaround: Set the Culture of the RadMaskedEditBox to English.
Please refer to the attached gif file demonstrating how to reproduce the problem. Workaround: close the popup when pressing Backspace: this.radTextBox1.TextBoxElement.TextBoxItem.TextBoxControl.KeyDown+=TextBoxControl_KeyDown; private void TextBoxControl_KeyDown(object sender, KeyEventArgs e) { if (e.KeyData== Keys.Back) { TextBoxSpellChecker textBoxSpellChecker = _radSpellChecker.GetControlSpellChecker(typeof(RadTextBox)) as TextBoxSpellChecker; if (textBoxSpellChecker!=null) { textBoxSpellChecker.DropDownMenu.ClosePopup(RadPopupCloseReason.Keyboard); } } }
Workaround: public Form1() { InitializeComponent();); this.richTextBox1.Text = "thess is is a tesssset"; this.radSpellChecker1.AutoSpellCheckControl = this.richTextBox1; this.radSpellChecker1.SpellingFormShowing += radSpellChecker1_SpellingFormShowing; } private void radSpellChecker1_SpellingFormShowing(object sender, SpellingFormShowingEventArgs e) { e.SpellingForm.FormClosed -= SpellingForm_FormClosed; e.SpellingForm.FormClosed += SpellingForm_FormClosed; } private void SpellingForm_FormClosed(object sender, FormClosedEventArgs e) { this.radSpellChecker1.AutoSpellCheckControl = null; this.radSpellChecker1.AutoSpellCheckControl = this.richTextBox1; }
How to reproduce: public RadForm1() { InitializeComponent(); this.radDateTimePicker1.Format = DateTimePickerFormat.Custom; this.radDateTimePicker1.CustomFormat = "MM/dd/yyyy"; this.radDateTimePicker1.DateTimePickerElement.Calendar.HeaderNavigationMode = Telerik.WinControls.UI.HeaderNavigationMode.Zoom; ((Telerik.WinControls.UI.MaskDateTimeProvider)this.radDateTimePicker1.DateTimePickerElement.TextBoxElement.Provider).AutoSelectNextPart = true; } Workaround: public RadForm1() { InitializeComponent(); this.radDateTimePicker1.Format = DateTimePickerFormat.Custom; this.radDateTimePicker1.CustomFormat = "MM/dd/yyyy"; this.radDateTimePicker1.DateTimePickerElement.Calendar.HeaderNavigationMode = Telerik.WinControls.UI.HeaderNavigationMode.Zoom; ((Telerik.WinControls.UI.MaskDateTimeProvider)this.radDateTimePicker1.DateTimePickerElement.TextBoxElement.Provider).AutoSelectNextPart = true; this.radDateTimePicker1.DateTimePickerElement.TextBoxElement.KeyDown += TextBoxElement_KeyDown; } private void TextBoxElement_KeyDown(object sender, KeyEventArgs e) { RadMaskedEditBoxElement tb = (RadMaskedEditBoxElement)sender; MaskDateTimeProvider provider = (MaskDateTimeProvider)tb.Provider; switch (provider.List[provider.SelectedItemIndex].type) { case PartTypes.Month: if (e.KeyCode == Keys.Left) { provider.SelectedItemIndex = provider.List.Count; } break; case PartTypes.Year: if (e.KeyCode == Keys.Right) { provider.SelectedItemIndex = -1; } break; } }
To reproduce: this.radDateTimePicker1.Format = DateTimePickerFormat.Short; this.radDateTimePicker1.Value = new DateTime(2016, 5, 12); this.radTextBox1.Text = "9/5/2016"; Second scenario: this.radDateTimePicker1.Format = DateTimePickerFormat.Short; If you copy "1/7/16" and paste it into RadDateTimeicker, the result date will be "1/7/1616". In the previous version, the result was correct 1/7/2016. Copy the value in the text box and paste it in RadDateTimePicker. Workaround: public Form1() { InitializeComponent(); this.radDateTimePicker1.Format = DateTimePickerFormat.Short; this.radDateTimePicker1.Value = new DateTime(2016, 5, 12); this.radTextBox1.Text = "9/5/2016"; this.radDateTimePicker1.ValueChanging += radDateTimePicker1_ValueChanging; this.radDateTimePicker1.DateTimePickerElement.TextBoxElement.TextBoxItem.TextBoxControl.KeyPress += TextBoxControl_KeyPress; } string clipboardData; private void TextBoxControl_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == '\x16') { if (clipboardData != null) { this.radDateTimePicker1.Text = clipboardData; clipboardData = null; } } } private void radDateTimePicker1_ValueChanging(object sender, Telerik.WinControls.UI.ValueChangingEventArgs e) { if (clipboardData == null) { clipboardData = RadMaskedEditBoxElement.GetClipboardText(); } }
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; } }
To reproduce: this.radTextBox1.NullText = "text"; this.radTextBox1.TextBoxElement.TextBoxItem.NullTextColor = Color.Red; Workaround: this.radTextBox1.TextBoxElement.NullTextColor = Color.Red;
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: 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+.
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
Use attached to reproduce. - Open the dialog multiple times.
How to reproduce: check the attached project and video Workaround: set a minimum size to the control public partial class RadForm1 : RadForm { public RadForm1() { InitializeComponent(); this.radTextBox1.MinimumSize = new Size(0, 20); } }
To reproduce: please refer to the attached sample screenshots and project. Note: this issue is relevant for RadDropDownList as well. Workaround: this.radDropDownList2.DropDownListElement.TextBox.TextBoxItem.Multiline = true; this.radDropDownList2.DropDownListElement.TextBox.TextBoxItem.MinSize = new Size(30, 15);
How to reproduce: radDateTimePicker1.DateTimePickerElement.ShowTimePicker = true; radDateTimePicker1.Format = DateTimePickerFormat.Custom; radDateTimePicker1.DateTimePickerElement.CalendarSize = new Size(330, 250); radDateTimePicker1.ReadOnly = true; Workaround: this.radDateTimePicker1.DateTimePickerElement.ShowTimePicker = true; this.radDateTimePicker1.Format = DateTimePickerFormat.Custom; this.radDateTimePicker1.DateTimePickerElement.CalendarSize = new Size(330, 250); this.radDateTimePicker1.ReadOnly = true; RadDateTimePickerCalendar calendarBehavior = this.radDateTimePicker1.DateTimePickerElement.GetCurrentBehavior() as RadDateTimePickerCalendar; calendarBehavior.TimePicker.TimePickerElement.ReadOnly = true;
How to reproduce: add a spellchecker to the form and configure it to spellcheck a multi line text box with a very long text. Workaround: use RadTextBoxControl
How to reproduce: Just open the popup with the Alt and Down arrow key combination, you will notice that the value changes Workaround: public partial class Form1 : Form { public Form1() { InitializeComponent(); this.radDateTimePicker1.DateTimePickerElement.KeyDown += DateTimePickerElement_KeyDown; } private void DateTimePickerElement_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.F4 || (e.KeyData == (Keys.Alt | Keys.Down))) { e.Handled = true; } } }
Workaround: class MyTextBoxInputHandler : TextBoxInputHandler { public MyTextBoxInputHandler(RadTextBoxControlElement el) : base(el) { } public override bool ProcessMouseWheel(MouseEventArgs e) { return false; } } radTextBoxControl1.TextBoxElement.InputHandler = new MyTextBoxInputHandler(radTextBoxControl1.TextBoxElement);