When the user is typing before already typed text, the text is overridden. Add the ability to insert characters instead of replacing them like in the .Net MaskedTextBox.
In specific environmental conditions related to the culture settings, RadDateTimePicker can't change its selected date upon user selection.
To reproduce: -add a GridViewDateTimeColumn to a RadGridView. -try to set RadDateTimeEditor.MaxValue in CellEditorInitialized event to 31/12/9999. As a result ArgumentOutOfRangeException("MaxDate cannot be higher than the max date") is thrown
To reproduce: radDateTimePicker1.MinDate = new DateTime(2013, 9, 1); radDateTimePicker1.MaxDate = new DateTime(2013, 9, 15); radDateTimePicker1.NullDate = new DateTime(2013, 9, 1); radDateTimePicker1.NullText = "text"; Start the app and set the year to "1111", then click some button to cause the date time picker to lose focus. At this point, print the control Text and Value. While the text is correct, the value shows with year "1111" and is not validated by the MinDate 2013/9/1 Workaround - work with null and NullableValue instead of NullDate and a specific date, or use the following class class MyRadDateTimePicker : RadDateTimePicker { public override DateTime Value { get { DateTime? date = this.DateTimePickerElement.Value; if (date.HasValue) { if (date < this.MinDate) { return this.MinDate; } if (date > this.MaxDate) { return this.MaxDate; } return date.Value; } return this.MinDate; } set { base.Value = value; } }
To reproduce: - add a RadTextBox with empty Text property but NullText property has some value. - change the Font style to Microsoft Sans Serif, 8.5pt. As a result the RadTextBox height is decresed a little and the NullText is cut off Workaround: use Text property instead of NullText and cutomize its ForeColor to gray: Font newFont = new Font("Microsoft Sans Serif", 8.5f); public Form1() { InitializeComponent(); this.radTextBox1.Font = newFont; this.radTextBox1.Text = this.radTextBox1.NullText; this.radTextBox1.TextBoxElement.ForeColor = Color.Gray; this.radTextBox1.GotFocus+=radTextBox1_GotFocus; this.radTextBox1.LostFocus+=radTextBox1_LostFocus; this.radButton1.Select(); } private void radTextBox1_LostFocus(object sender, EventArgs e) { if (this.radTextBox1.Text==this.radTextBox1.NullText||this.radTextBox1.Text==string.Empty) { this.radTextBox1.Text = this.radTextBox1.NullText; this.radTextBox1.TextBoxElement.ForeColor = Color.Gray; } else { this.radTextBox1.TextBoxElement.ForeColor = Color.Black; } } private void radTextBox1_GotFocus(object sender, EventArgs e) { if (this.radTextBox1.Text==this.radTextBox1.NullText) { this.radTextBox1.Text = string.Empty; this.radTextBox1.TextBoxElement.ForeColor = Color.Gray; } else { this.radTextBox1.TextBoxElement.ForeColor = Color.Black; } }
When users select the "Ignore All" on the certain word the other ocupation of this word still market as wrong.
To reproduce: Create two forms - form 1 has a button which creates a new form 2 Form 2 has a button and a RichTextBox. The button should create a spellchecker. Write something into the richtextbox and click the button. Close the spellchecking form and form 2. Repeat a few times, memory usage should increase.
To reproduce: - add a RadMaskedEditBox with MaskType = MaskType.Standard - input some numbers to fill all the expected digits - select the content in the RadMaskedEditBox and press Enter key. As a result the last number is removed Workaround: private void radMaskedEditBox1_KeyPress(object sender, KeyPressEventArgs e) { e.Handled = e.KeyChar == (char)Keys.Return; }
To reproduce - add some text to the control and its IsReadOnly to true. Right click and observe the context menu Workaround: radTextBoxControl1.ContextMenuOpening += radTextBoxControl1_ContextMenuOpening; void radTextBoxControl1_ContextMenuOpening(object sender, TreeBoxContextMenuOpeningEventArgs e) { e.ContextMenu.DropDownOpened -= ContextMenu_DropDownOpened; e.ContextMenu.DropDownOpened += ContextMenu_DropDownOpened; } void ContextMenu_DropDownOpened(object sender, EventArgs e) { TextBoxControlDefaultContextMenu contextMenu = (TextBoxControlDefaultContextMenu)sender; if (radTextBoxControl1.IsReadOnly) { foreach (RadMenuItemBase item in contextMenu.Items) { if (item.Text == "Cu&t" || item.Text == "&Copy" || item.Text == "&Paste" || item.Text == "&Delete") { item.Enabled = false; } } } }
To reproduce: - Add text that contain multiple blank lines to a textBox - Set SpellCheckMode to AllAtOnce - Perform a spell check.
Description: RadMaskedEditBox (with MaskType=Numeric and Mask = "c") is bound to a property of type decimal. If you type in 15 it goes into the maskedEditbox as 51. Reproduce: -add a BindingSource (DataSource is set to some data table: for example "Products") -add a BindingNavigator (Binding Source is set to the previously added bindingNavigator1) -add a RadMaskedEditBox (with MaskType=Numeric and Mask = "c") with DataBindings: Value => bindingSource1 - UnitPrice -add a new record using the yellow plus sign button in the navigator; get to the price field and just start typing your number: if you type in 15, it goes into the RadMaskedEditBox as 51. Workaround: Bind to Text instead of binding to Value of the RadMaskedEditBox this.radMaskedEditBox1.DataBindings.Add(new Binding("Text", bindingSource1, "UnitPrice", true)); Resolution: RadMaskedEditBox with currency mask does not support null values. Default value must be 0 instead null. Please use the following code snippet: this.mePrice.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.bindingSource1, "Price", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged, 0, "C2"));
To reproduce: RadTextBox txtAction = new Telerik.WinControls.UI.RadTextBox(); txtAction.Dock = System.Windows.Forms.DockStyle.Fill; this.Controls.Add(txtAction); Workaround: void txtAction_Resize(object sender, EventArgs e) { txtAction.TextBoxElement.InvalidateMeasure(true); txtAction.TextBoxElement.UpdateLayout(); }
To reproduce: Add RadAutoCompleteTextBox, add a AutoCompleteDataSource, complete a word, click the close button of the word, try to type. Workaround: void RadForm1_Load(object sender, EventArgs e) { RemoveFocus(); } void radAutoCompleteBox1_TextChanged(object sender, EventArgs e) { RemoveFocus(); } private void RemoveFocus() { foreach (var item in this.radAutoCompleteBox1.TextBoxElement.ViewElement.Children) { foreach (var btn in item.Children) { var radButtonElement = btn as RadButtonElement; if (radButtonElement != null) { radButtonElement.CanFocus = false; } } } }
To reproduce: Add RadAutoCompleteBox Add AutoCompleteItems Change the theme to Office2010BlueTheme, Office2010BlackTheme, Office2007SilverTheme or Office2010SilverTheme. Write something - looks good Autocomplete a word and now write something - text is a few pixels lower. Workaround: void radAutoCompleteBox2_TextBlockFormatting(object sender, TextBlockFormattingEventArgs e) { TokenizedTextBlockElement token = e.TextBlock as TokenizedTextBlockElement; if (token != null) { token.Margin = new Padding(0, 1, 1, 1); } }
RadMaskEditBox - does not work correctly when the whole text is selected and user presses key "Enter". Control removes the last character. Workaround: Public Class Form1 Dim text1 As String Dim text2 As String Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown If e.KeyData = Keys.Enter Then SendKeys.Send("{TAB}") End If End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Me.RadMaskedEditBox1.MaskType = Telerik.WinControls.UI.MaskType.Standard Me.RadMaskedEditBox2.MaskType = Telerik.WinControls.UI.MaskType.Standard Me.RadMaskedEditBox1.Mask = "00/00/00" Me.RadMaskedEditBox1.Text = "__/__/__" Me.RadMaskedEditBox2.Mask = "00/00/00" Me.RadMaskedEditBox2.Text = "__/__/__" End Sub Private Sub RadMaskedEditBox1_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadMaskedEditBox1.GotFocus RadMaskedEditBox1.SelectAll() text1 = Me.RadMaskedEditBox1.Text End Sub Private Sub RadMaskedEditBox1_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadMaskedEditBox1.LostFocus Me.RadMaskedEditBox1.Text = text1 End Sub Private Sub RadMaskedEditBox1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles RadMaskedEditBox1.KeyDown If e.KeyData = Keys.Enter Then text1 = Me.RadMaskedEditBox1.Text End If End Sub Private Sub RadMaskedEditBox2_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadMaskedEditBox2.GotFocus RadMaskedEditBox2.SelectAll() text2 = Me.RadMaskedEditBox2.Text End Sub Private Sub RadMaskedEditBox2_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadMaskedEditBox2.LostFocus Me.RadMaskedEditBox2.Text = text2 End Sub Private Sub RadMaskedEditBox2_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles RadMaskedEditBox2.KeyDown If e.KeyData = Keys.Enter Then text2 = Me.RadMaskedEditBox2.Text End If End Sub End Class
To reproduce: -wire to the PreviewKeyDown event like this: radMaskedEditBox1.PreviewKeyDown += radMaskedEditBox1_PreviewKeyDown Workaround: -wire to the TextBoxItem PreviewKeyDown: radMaskedEditBox1.MaskedEditBoxElement.TextBoxItem.PreviewKeyDown += TextBoxItem_PreviewKeyDown;
To reproduce: Populate the AutoCompleteBox and start a search returning enough results to need the scrollbar. When clicking and dragging the scroll bar to scroll - if the cursor is not positioned directly over the scrollbar at the time you release the mouseclick, the dropdown list is closed an item is added to the selection. Workaround: public partial class Form1 : Form { bool isMouseDown = false; public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { AddAutoCompleteItems(); radAutoCompleteBox1.ListElement.VScrollBar.MouseDown += ListElement_MouseDown; radAutoCompleteBox1.ListElement.VScrollBar.MouseUp += ListElement_MouseUp; radAutoCompleteBox1.TokenValidating += radAutoCompleteBox1_TokenValidating; } void radAutoCompleteBox1_TokenValidating(object sender, TokenValidatingEventArgs e) { e.IsValidToken = !isMouseDown; isMouseDown = false; } void ListElement_MouseUp(object sender, MouseEventArgs e) { RadListVisualItem el = radAutoCompleteBox1.ListElement.ElementTree.GetElementAtPoint(e.Location) as RadListVisualItem; if (el != null) { return; } isMouseDown = false; } void ListElement_MouseDown(object sender, MouseEventArgs e) { isMouseDown = true; } private void AddAutoCompleteItems() { RadListDataItemCollection items = this.radAutoCompleteBox1.AutoCompleteItems; items.Add(new RadListDataItem("Joe Smith", "joe@fakecompany.com")); items.Add(new RadListDataItem("Adam Petersen", "adam@qwerty.com")); items.Add(new RadListDataItem("Jack Russel", "jack@russel.nocom")); items.Add(new RadListDataItem("Daniel Finger", "daniel.pinger@gmail.com")); items.Add(new RadListDataItem("Richard Vail", "rvail@richardvail.com")); items.Add(new RadListDataItem("Sebastian Jonnson", "s.jonnson@sjonnson.com")); items.Add(new RadListDataItem("Lee Cooper", "lee.cooper@coopercoorp.com")); items.Add(new RadListDataItem("Kelvin Clain", "kclain@clainkevin.com")); items.Add(new RadListDataItem("Maria Jenson", "mjenson@mariajenson.com")); items.Add(new RadListDataItem("Chelsea Maarten", "chelsea@maarten.com")); items.Add(new RadListDataItem("Jenson Chew", "jenson.chew@nospam.com")); items.Add(new RadListDataItem("Martin Williams", "m.williams@martinandwilliams.com")); items.Add(new RadListDataItem("Telerik", "clientservice@telerik.com")); items.Add(new RadListDataItem("James Stone", "james.stone@manystones.com")); items.Add(new RadListDataItem("Samuel Jackson", "samuel.jackson@nojackson.com")); } } public class MyRadAutoCompleteBox : RadAutoCompleteBox { protected override RadTextBoxControlElement CreateTextBoxElement() { return new MyRadAutoCompleteBoxElement(); } } public class MyRadAutoCompleteBoxElement : RadAutoCompleteBoxElement { protected override TextBoxViewElement CreateViewElement() { return new MyAutoCompleteBoxViewElement(); } protected override Type ThemeEffectiveType { get { return typeof(RadAutoCompleteBoxElement); } } } public class MyAutoCompleteBoxViewElement : AutoCompleteBoxViewElement { protected override int InsertTokenizedTextBlocks(int index, string text, bool performInvalidation) { bool isValid = performInvalidation ? this.OnTokenValidating(text) : true; if (!isValid) { return index; } return base.InsertTokenizedTextBlocks(index, text, performInvalidation); }
When NumberFormat.NumberDecimalSeparator is same with NumberFormat.CurrencyGroupSeparator numbers cannot be edited and deleted. As a workaround set these separators to different values.
Add support for case sensitivity search in the suggested elements.
This behavior comes from the nested MaskedEditBox. RadDateTimePicker behaves the same way - this is core logic and should be the same.