To reproduce: Add a RadSpellChecker and a RichTextBox, set the spell checker to check the RichTextBox on some button click. Set the main form's TopMost property to true. Start the form, you will notice that sometimes the dialog for spellchecking and the complete messagebox show behind the main form. Workaround: public class MyRadSpellChecker : RadSpellChecker { private FormSettings formSettingsForCurrentSpellCheckIteration = new FormSettings(); public MyRadSpellChecker() { } protected override void CheckAllAtOnce(IControlSpellChecker spellChecker) { Form spellCheckerParentForm = this.GetSpellCheckerParentForm(spellChecker); RadDocument editingElementContentToRadDocument = spellChecker.GetContentAsDocument(); editingElementContentToRadDocument.Measure(RadDocument.MAX_DOCUMENT_SIZE); IControlSpellChecker richTextBoxSpellChecker = this.GetControlSpellChecker(typeof(RadRichTextBox)); SpellCheckAllAtOnceForm checkAllAtOnceWindow = new SpellCheckAllAtOnceForm(editingElementContentToRadDocument, richTextBoxSpellChecker, spellChecker); if (!checkAllAtOnceWindow.HasErrors) { this.ShowSpellCheckingCompleteDialog(spellCheckerParentForm); return; } this.CopyFormSettings(this.FormSettings, checkAllAtOnceWindow); SpellingFormShowingEventArgs args = new SpellingFormShowingEventArgs(checkAllAtOnceWindow, spellChecker); this.OnSpellingFormShowing(args); if (args.Cancel) { return; } Form form = args.SpellingForm; form.ShowDialog(spellCheckerParentForm); } private void CopyFormSettings(FormSettings from, RadForm to) { to.Location = from.Location; to.StartPosition = from.StartPosition; ThemeResolutionService.ApplyThemeToControlTree(to, from.ThemeName); } private void ShowSpellCheckingCompleteDialog(Form parentForm = null) { if (this.EnableCompleteMessageBox) { string themeName = RadMessageBox.ThemeName; RadMessageBox.ThemeName = this.ThemeName; string title = RadSpellCheckerLocalizationProvider.CurrentProvider.GetLocalizedString(RadSpellCheckerStringId.Title); string complete = RadSpellCheckerLocalizationProvider.CurrentProvider.GetLocalizedString(RadSpellCheckerStringId.Complete); RadMessageBox.Show(parentForm, complete, title, MessageBoxButtons.OK); RadMessageBox.ThemeName = themeName; } } protected override void CheckWordByWord(IControlSpellChecker spellChecker) { this.CopyWindowSettings(this.FormSettings, this.formSettingsForCurrentSpellCheckIteration); DialogResult result = DialogResult.None; do { result = this.ShowWindowForNextError(spellChecker); } while (result != DialogResult.None && result == DialogResult.OK); } private void CopyWindowSettings(FormSettings from, FormSettings to) { to.Location = from.Location; to.StartPosition = from.StartPosition; to.ThemeName = from.ThemeName; } private DialogResult ShowWindowForNextError(IControlSpellChecker spellChecker) { Form spellCheckerParentForm = this.GetSpellCheckerParentForm(spellChecker); spellChecker.ResetFields(); IWordInfo incorrectWordInfo = spellChecker.MoveToNextError(); if (incorrectWordInfo == null) { this.ShowSpellCheckingCompleteDialog(spellCheckerParentForm); return DialogResult.None; } RadForm checkWordByWordWindow = new SpellCheckWordByWordForm(incorrectWordInfo.Word, spellChecker); this.CopyFormSettings(this.formSettingsForCurrentSpellCheckIteration, checkWordByWordWindow); SpellingFormShowingEventArgs args = new SpellingFormShowingEventArgs(checkWordByWordWindow, spellChecker); this.OnSpellingFormShowing(args); if (args.Cancel) { return DialogResult.None; } checkWordByWordWindow = args.SpellingForm; spellChecker.CurrentControl.Focus(); return checkWordByWordWindow.ShowDialog(spellCheckerParentForm); } private Form GetSpellCheckerParentForm(IControlSpellChecker spellChecker) { if (spellChecker != null && spellChecker.CurrentControl != null) { return spellChecker.CurrentControl.FindForm(); } return null; } }
To reproduce: Add a TableLayout and in the cells add a RadtextBox with its multiline property set to true. Resize the form until the textboxes and unclickable and no scrollbars are shown. This behavior does not always occur. Workaround: Use a custom RadTextBox class: public class MyTextBox : RadTextBox { protected override void InitializeTextElement() { this.GetType().BaseType.GetField("textBoxElement", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(this, new MyTextBoxElement()); this.TextBoxElement.StretchVertically = true; this.TextBoxElement.ShowBorder = true; } } public class MyTextBoxElement : RadTextBoxElement { protected override SizeF MeasureOverride(SizeF availableSize) { availableSize.Width -= BorderThickness.Size.Width; availableSize.Height -= BorderThickness.Size.Height; SizeF desiredSize = this.MeasureChildren(availableSize); return desiredSize; } protected override Type ThemeEffectiveType { get { return typeof(RadTextBoxElement); } } }
To reproduce: Add a radspellchecker and let it check a radrichtextbox. Check an incorrect word and click ignore all. You will see that the dialog shows up again. Workaround: public class MySpellCheckWordByWordForm : SpellCheckWordByWordForm {
To reproduce: use the following code: public Form1() { InitializeComponent(); RadMaskedEditBox maskControl = new RadMaskedEditBox(); maskControl.TextMaskFormat = System.Windows.Forms.MaskFormat.ExcludePromptAndLiterals; CultureInfo ci = CultureInfo.CreateSpecificCulture(Thread.CurrentThread.CurrentCulture.Name); ci.NumberFormat.NumberGroupSeparator = ""; maskControl.Culture = ci; maskControl.Text = "2"; object o = maskControl.Value; //Exception!! this.Controls.Add(maskControl); } Workaround: Do not set NumberGroupSeparator to String.Empty when TextMaskFormat=ExcludePromptAndLiterals
To reproduce: -add a RadTimePicker; -change its culture: this.radTimePicker1.Culture = new System.Globalization.CultureInfo("en-GB"); Workaround: public Form1() { InitializeComponent(); this.radTimePicker1.Culture = new System.Globalization.CultureInfo("en-GB"); this.radTimePicker1.TimePickerElement.PopupForm.Height =350; }
To reproduce: - Add RadDateTimePicker to a form and set its ReadOnly property to true. - Paste a valid value using the Ctrl+V key combination. Workaround: - Disable the corresponding key combination in the KeyDown event: void radDateTimePicker1_KeyDown(object sender, KeyEventArgs e) { if (e.Control && e.KeyCode == Keys.V) { e.SuppressKeyPress = true; } }
To reproduce: - Add RadMaskedEditBox to a form and set its ReadOnly property to true. - Paste a valid value using the Ctrl+V key combination. Workaround: - Disable the corresponding key combination in the KeyDown event: void radMaskedEditBox1_KeyDown(object sender, KeyEventArgs e) { if (e.Control && e.KeyCode == Keys.V) { e.SuppressKeyPress = true; } }
To reproduce: - Subscribe to MaskedEditBox Element PropertyChanged event. - You will notice that when you changing the value will not raise the event. Workaround: You can track the Text property for changes and parse the text to appropriate value.
To reproduce: -add RadTimePicker and set its value to null. -click the arrow to open the pop up and notice that clock header used the default general DateTime pattern to display the text (e.g. 9/18/2013 12:00:00 AM), instead of using the short time pattern displayed (e.g. 12:00 AM) Workaround: this.radTimePicker1.Value = null; this.radTimePicker1.TimePickerElement.PopupOpened+=TimePickerElement_PopupOpened; private void TimePickerElement_PopupOpened(object sender, EventArgs e) { this.radTimePicker1.TimePickerElement.PopupContentElement.ClockHeaderElement.Text = DateTime.Now.ToString(this.radTimePicker1.TimePickerElement.Format, this.radTimePicker1.TimePickerElement.Culture); }
To reproduce: - Add a blank mask to a form and set its Mask type to Standard. - Set its mask to "###-##-##"; - Set its PromptChar to a single space. - Now set the caret before the '-' and type a two digits (the first digit is overridden by the second because the caret is not moved properly). Workaround: Subscribe to the following KeyDown event: void box1_KeyDown(object sender, KeyEventArgs e) { int caretPos = this.box1.MaskedEditBoxElement.TextBoxItem.SelectionStart; if ((e.KeyCode != Keys.Left && e.KeyCode != Keys.Right) && (e.KeyCode != Keys.Up && e.KeyCode != Keys.Down)) { if (caretPos < box1.Text.Length && box1.Text[caretPos] == '-') { this.box1.MaskedEditBoxElement.TextBoxItem.SelectionStart++; } } }
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: 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.
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); } }