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)
{
}
Use the following code snippet:
this.radMaskedEditBox1.Mask = "99/99/99/99/99/99";
this.radMaskedEditBox1.MaskType = Telerik.WinControls.UI.MaskType.Standard;
this.radMaskedEditBox1.PromptChar = ' ';
((StandartMaskTextBoxProvider)this.radMaskedEditBox1.MaskedEditBoxElement.Provider).TryGetStandardProvider().InsertKeyMode = InsertKeyMode.Overwrite;
When the cursor is just before the last "/", if you enter a number, then the cursor does not move after this last "/". Then entering another digit overwrites the last digit typed.
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;
Hi,
We have an issue with the RadMaskedEditBox control using an f0 mask.
The issue we have is..
When entering a number i.e. 123456 followed by pressing the backspace key, results in the number showing as 123450
We would expect this to show as 12345 so assume this is either a bug or requires up to add additional configuration when using f0.
I have included an example which demonstrates this
Many thanks
The workaround in the following MSDN resources results in an incorrect behavior in the header of RadDateTimePicker: https://code.msdn.microsoft.com/Fixing-Persian-Locale-for-6e66e044#content
The issue can be reproduced with custom regional settings and the following mask: dd/MM/yyyy Workaround: if possible please reset the DateTime region settings
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; }
Set the property to the hosted textbox instead: Me.RadSpinEditor1..SpinElement.TextBoxItem.TabStop = False or create a custom control: Public Class MyRadSpinEditor Inherits RadSpinEditor <DefaultValue(True)> Public Overloads Property TabStop As Boolean Get If Me.SpinElement.TextBoxItem IsNot Nothing Then Return Me.SpinElement.TextBoxItem.TabStop End If Return MyBase.TabStop End Get Set(ByVal value As Boolean) If Me.SpinElement.TextBoxItem IsNot Nothing Then MyBase.TabStop = False Me.SpinElement.TextBoxItem.TabStop = value Return End If MyBase.TabStop = value End Set End Property End Class
To reproduce: follow the steps illustrated in the gif file. 1. Set Autosize = false. 2. Resize the control by increasing its height. 3. Change Multiline property to true. 4. Change Multiline property to false. 5. Autosize property is reset by doing 4. So set Autosize to false again. Workaround: Use only the Multiline property.
To reproduce: handle the following event and start typing in the editable part. You will notice that the TextChanged event is not fired: Me.RadPopupEditor1.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDown AddHandler Me.RadPopupEditor1.TextChanged, AddressOf RadPopupEditor1_TextChanged Workaround: handle the RadPopupEditor.TextBoxElement.TextChanged event instead.
To reproduce: set the ThemeName property before setting the RadDateTimePickerCalendarShowTimePicker property to true. Private Sub RadForm1_Load(sender As Object, e As EventArgs) Handles MyBase.Load Me.RadDateTimePicker1.ThemeName = "TelerikMetro" TryCast(Me.RadDateTimePicker1.DateTimePickerElement.CurrentBehavior, RadDateTimePickerCalendar).ShowTimePicker = True End Sub Workaround: Private Sub RadForm1_Load(sender As Object, e As EventArgs) Handles MyBase.Load TryCast(Me.RadDateTimePicker1.DateTimePickerElement.CurrentBehavior, RadDateTimePickerCalendar).ShowTimePicker = True Me.RadDateTimePicker1.ThemeName = "TelerikMetro" End Sub
To reproduce: radPopupEditor1.PopupForm.VerticalPopupAlignment = VerticalPopupAlignment.TopToBottom; Workaround: private void RadPopupEditor1_PopupOpening(object sender, CancelEventArgs e) { var args = e as RadPopupOpeningEventArgs; args.CustomLocation = new Point(args.CustomLocation.X, args.CustomLocation.Y - (radPopupEditor1.Height + radPopupEditor1.PopupForm.Height)); }
How to reproduce: Set the AutoSpellCheckControl property of the spell checker and use it in a DPI-aware application on a system with an increased scaling. Type an incorrect and notice that the context menu will not be scaled. Workaround: Public Class RadForm1 Sub New() InitializeComponent() 'TextBox Me.RadSpellChecker1.AutoSpellCheckControl = Me.TextBox1 Dim dpi = NativeMethods.GetSystemDpi() Dim checker = TryCast(Me.RadSpellChecker1.GetControlSpellChecker(GetType(TextBox)), TextBoxSpellChecker) checker.DropDownMenu.PopupElement.DpiScaleChanged(New SizeF(dpi.X / 96, dpi.Y / 96)) 'RadTextBox 'Me.RadSpellChecker1.AutoSpellCheckControl = Me.RadTextBox1 'Dim dpi = NativeMethods.GetSystemDpi() 'Dim checker = TryCast(Me.RadSpellChecker1.GetControlSpellChecker(GetType(RadTextBox)), TextBoxSpellChecker) 'checker.DropDownMenu.PopupElement.DpiScaleChanged(New SizeF(dpi.X / 96, dpi.Y / 96)) End Sub End Class
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;
See attached video to reproduce.