This behavior can be observed in the Office2010 theme. In the following image, the button's width in RadCalculatorDropDown and RadSpinEditor is less by 1 px compared to the buttons in the other editor controls.
Sample code to reproduce the case:
if (int.TryParse(txtCount.Text, out int count))
{
string textToSet=new string('A', count)+"END";
txtSample.Text = textToSet;
this.radTextBox1.MaxLength = textToSet.Length;
this.Text = txtSample.Text.Length.ToString();
}
To reproduce: use Korean (Microsoft IME) keayboard this.radTextBoxControl1.ImeMode = System.Windows.Forms.ImeMode.Hangul; Workaround: this.radTextBoxControl1.KeyUp+=radTextBoxControl1_KeyUp; private void radTextBoxControl1_KeyUp(object sender, KeyEventArgs e) { this.radTextBoxControl1.SelectionStart = this.radTextBoxControl1.Text.Length; }
Note: the issue can be also observed in the textbox editor in RadGridView.
Currently, you cannot enter the date in RadDateTimePicker by typing it in the textbox area.
Use attached project and the following steps: - When the application starts, use the drop down calendar to select another date. - Then press Ctrl+A to select the entire content of the editor and press the Del key to clear the content. - Now press the right arrow key and it crashes with a NullReferenceException inside of the RadDateTimePickerElement.OnKeyDown method. - This bug only occurs when ShowCheckBox is true. Workaround: class MyRadDateTimePicker : RadDateTimePicker { protected override RadDateTimePickerElement CreateElement() { return new MyRadDateTimePickerElement(); } } class MyRadDateTimePickerElement : RadDateTimePickerElement { protected override void OnKeyDown(KeyEventArgs e) { var provider = this.TextBoxElement.Provider as MaskDateTimeProvider; if (e.KeyCode == Keys.Right && provider.List != null) { base.OnKeyDown(e); } } protected override Type ThemeEffectiveType { get { return typeof(RadDateTimePickerElement); } } }
To reproduce: - Disable the control. - The text box has a white background. - Workaround: Set the back color of the RadTimeMaskedEditBoxElement in for the disabled state in Visual Style Builder.
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
The new functionality should prevent duplicates to be added as tokens in the editor. An already selected item should not be visible in the popup as well. The attached 1148813-AutocompleteDuplicates.zip project features a possible custom solution.
You need to press Tab twice to move to the next control when in popup editor.
Use attached to reproduce.
Hello,
I have noticed a bug in the Autocompletebox.
When the Autocompletebox.Multiline is enabled and setting the text to an item with multiple delimiters where the items are shown on multiple lines (see image).
When clicking on one of the items in line 2 or 3, the value e.selectionstart returned on the Selectionchanged-event has a wrong value.
On line 2 the e.selectionstart is 1 too much
Imports Telerik.WinControls.UI Public Class RadForm1 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim str As String = "Item 1;Item 2;Item 3;Item 4;Item 5;Item 6;Item 7;Item 8;Item 9;Item 10;" RadAutoCompleteBox1.Multiline = True RadAutoCompleteBox1.Text = str End Sub Private Sub RadAutoCompleteBox1_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles RadAutoCompleteBox1.SelectionChanged Dim SelectedItem As String = RadAutoCompleteBox1.Text.Substring(e.SelectionStart, e.SelectionLength) Debug.Print(SelectedItem) End Sub End Class
Workaround: use RadTextBoxControl.
Use attached to reproduce. - Open the dialog multiple times.
To reproduce: add a RadSpellChecker and a RadTextBoxControl and set the RadSpellChecker.AutoSpellCheckControl property to the RadTextBoxControl. When you type "Thisis", the red underline appears, indicating the error. However, if you use the context menu to correct the misspelled word, the red underline remains. Please refer to the attached gif file. Workaround: stop the default context menu and use the spell checking form instead: private void radTextBoxControl1_ContextMenuOpening(object sender,TreeBoxContextMenuOpeningEventArgs e) { e.Cancel = true; this.radSpellChecker1.Check(this.radTextBoxControl1); }
How to reproduce: public Form1() { InitializeComponent(); this.radMaskedEditBox1.Culture = new CultureInfo("ar-EG"); this.radMaskedEditBox1.Mask = "c"; this.radMaskedEditBox1.MaskType = Telerik.WinControls.UI.MaskType.Numeric; } Workaround: handle the KeyDown event private void radMaskedEditBox1_KeyDown(object sender, KeyEventArgs e) { if (this.radMaskedEditBox1.SelectionLength == this.radMaskedEditBox1.Text.Length) { this.radMaskedEditBox1.SelectionLength = 0; } }
Use the following code to setup RadMaskedEditBox. When you start typing you will notice that the ValueChanged event is fired but the ValueChanging is not:
this.radMaskedEditBox1.MaskType = MaskType.Standard;
this.radMaskedEditBox1.Mask = "AAAA";
this.radMaskedEditBox1.ValueChanged += radMaskedEditBox1_ValueChanged;
this.radMaskedEditBox1.ValueChanging += radMaskedEditBox1_ValueChanging;
private void radMaskedEditBox1_ValueChanging(object sender, CancelEventArgs e)
{
}
private void radMaskedEditBox1_ValueChanged(object sender, EventArgs e)
{
}
Steps:
1) Add a textbox to a form. Set tabindex set to 0.
2) Add a RadMaskedEditBox with tabindex set to 1, and add the code listed below.
public Form1() { InitializeComponent(); this.radMaskedEditBox1.MaskType = MaskType.Standard; this.radMaskedEditBox1.Mask = "000000"; this.radMaskedEditBox1.PromptChar = '#'; this.radMaskedEditBox1.SelectionStart = 0; this.radMaskedEditBox1.SelectionLength = 0; this.radMaskedEditBox1.Enter += radMaskedEditBox1_Enter; this.radMaskedEditBox1.Click += radMaskedEditBox1_Click; this.radMaskedEditBox1.MaskedEditBoxElement.TextBoxItem.Click += TextBoxItem_Click; } void radMaskedEditBox1_Enter(object sender, EventArgs e) { this.radMaskedEditBox1.SelectionStart = 0; } void TextBoxItem_Click(object sender, EventArgs e) { this.radMaskedEditBox1.SelectionStart = 0; } void radMaskedEditBox1_Click(object sender, EventArgs e) { }
3) Add breakpoints to all 3 RadMaskedEditBox events.
4) Run the app. Press tab key. (Enter event works as expected for the MaskedEditBox class).
5) Close and re-run app. Click the end of the MaskedEditBox. Click event is not invoked by the MaskedEditBox class as expected.
Expected Result:
Since this control really only has 1 primary subcontrol (a fancy textbox). Event subscriptions to Click should subscribe to MaskedEditBoxElement.TextBoxItem.Click the += operator...
Should be fixed for MouseUp/Down and the all the other related key and mouse events.
Actual Result:
Subscriptions to Enter work on the MaskedEditBox class, but only subscriptions to MaskedEditBoxElement.TextBoxItem.Click work for Click events. This is highly confusing to the programmer whom is used to subscribing the standard Click event of a given control, and makes for unnecessarily complicated code and knowledge of the internal Element structure to make it work as expect like any other control.
Feature request:
It would be nice if there was also a "SelectionStart_MouseClick" property that works similar to SelectionStart but for Click events.
Also a EnableSelectionStart_MouseClick property with a default of false to maintain existing control behavior.
This allows the user to override the default cursor start position for Mouse Clicks. In the case above, the user cannot enter numbers unless they specifically click the start of the Mask; users find that confusing...
The purpose of the above code is to be able to set the cursor start position "on-click", rather than only on Enter, which the existing SelectionStart property doesn't achieve.
Then we programmers could just set the properties and be done with it, and any subscriptions to the Click event would work as expected ->
public Form1() { InitializeComponent(); var customControl = new RadMaskedEditBoxV2() { MaskType = MaskType.Standard, Mask = "000000", PromptChar = '#', SelectionLength = 0, SelectionStart = 0, EnableSelectionStart_MouseClick = true, SelectionLength_MouseClick = 6, SelectionStart_MouseClick = 0 }; this.Controls.Add(customControl); }
public class RadMaskedEditBoxV2 : Telerik.WinControls.UI.RadMaskedEditBox { public RadMaskedEditBoxV2() : base() { this.EnableSelectionStart_MouseClick = false; this.MaskedEditBoxElement.TextBoxItem.Click += SelectionStartMouseClick_OnClick; } public new event EventHandler Click { add { base.MaskedEditBoxElement.TextBoxItem.Click += value; } remove { base.MaskedEditBoxElement.TextBoxItem.Click -= value; } } protected virtual void SelectionStartMouseClick_OnClick(object sender, EventArgs e) { if (EnableSelectionStart_MouseClick) { this.SelectionStart = SelectionStart_MouseClick; this.SelectionLength = SelectionLength_MouseClick; } } public int SelectionStart_MouseClick { get; set; } public int SelectionLength_MouseClick { get; set; } public bool EnableSelectionStart_MouseClick { get; set; } }
It would also allow the programmer to set the Enter and Click SelectionLengths separately.
Regards,
-Shawn.
Please refer to the following code snippet:
public Form1()After running the application and try to enter "123". You will notice that you can enter only "1".
To reproduce:
- Set SutoSize to false and resize the control vertically.
Workaround:
radMaskedEditBox1.MaskedEditBoxElement.StretchVertically = true;