Completed
Last Updated: 15 Jul 2019 08:33 by ADMIN
Release R3 2019 (LIB 2019.2.722)
Created by: Patrick
Comments: 2
Category: Editors
Type: Bug Report
1

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

On line 3 the e.selectionstart is 2 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

Completed
Last Updated: 23 May 2019 13:20 by ADMIN
Release R2 2019 SP1 (LIB 2019.2.603)

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)
        {
        }

Completed
Last Updated: 04 Apr 2019 15:54 by Dimitar
Release R2 2019 (LIB 2019.1.408)

Please refer to the following code snippet:

        public Form1()
        {
            InitializeComponent();
             
            this.radMaskedEditBox1.Mask = "n";
            this.radMaskedEditBox1.MaskType = Telerik.WinControls.UI.MaskType.Numeric;   
            this.radMaskedEditBox1.Culture = new CultureInfo("en-CA") { NumberFormat = { NumberDecimalDigits = 0, NumberGroupSeparator = "," } };  
        }

After running the application and try to enter "123". You will notice that you can enter only "1".

Completed
Last Updated: 27 Mar 2019 09:11 by Dimitar

To reproduce:

- Set SutoSize to false and resize the control vertically.

Workaround:

radMaskedEditBox1.MaskedEditBoxElement.StretchVertically = true;

Completed
Last Updated: 08 Apr 2019 10:04 by ADMIN

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.


Completed
Last Updated: 14 Feb 2019 16:49 by ADMIN
Created by: Graeme
Comments: 2
Category: Editors
Type: Bug Report
1

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

Completed
Last Updated: 26 Nov 2018 15:43 by Dimitar
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
Completed
Last Updated: 11 Oct 2018 14:29 by Dimitar
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
Completed
Last Updated: 11 Oct 2018 14:12 by ADMIN
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.
Completed
Last Updated: 17 Sep 2018 09:53 by Dimitar
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
Completed
Last Updated: 27 Sep 2018 11:56 by Dimitar
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.
Completed
Last Updated: 15 Aug 2018 06:47 by Dimitar
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
Completed
Last Updated: 06 Aug 2018 06:44 by Dimitar
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

 

Completed
Last Updated: 19 Jul 2018 08:15 by Dimitar
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;
        }
    }

}
Completed
Last Updated: 12 Jul 2018 10:12 by ADMIN
To reproduce:
- Use the Fluent theme with RadSpinEditor on a HDPI monitor.

Workaround:
 var borderPrimitive = radSpinEditor1.SpinElement.Children[1] as BorderPrimitive;
borderPrimitive.BottomWidth = 2;

Completed
Last Updated: 11 Oct 2018 15:20 by Dimitar
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;
        }
Completed
Last Updated: 21 Jun 2018 14:39 by ADMIN
To reproduce:
- Set the DropDownSizingMode to None
- Show the popup several times.
- Each time the height is increased.

Workaround:
var popup = radPopupEditor1.PopupEditorElement.PopupForm as RadPopupContainerForm;
popup.SizingGrip.MinSize = new Size(0, 0);
Completed
Last Updated: 14 Jun 2018 07:46 by Dimitar
How to reproduce:  The spell checker`s AutoSpellCheckControl property must not be set. Add a ContextMenuStrip with several items and use it with a standard text box. Then perform a spell check with the RadSpellChecker control, e.g. like this: 

Me.RadSpellChecker1.Check(Me.TextBox1)

Then right-click in the text box, the context menu will not be shown.

Workaround: use RadContextMenu
https://docs.telerik.com/devtools/winforms/menus/contextmenu/context-menus
Completed
Last Updated: 21 Jun 2018 14:39 by ADMIN
Use the following code:
public RadForm1()
{
    InitializeComponent();
    radMaskedEditBox1.MaskType = Telerik.WinControls.UI.MaskType.Numeric;
    radMaskedEditBox1.Mask = "d0";
    radMaskedEditBox1.EnableNullValueInput = true;

    radMaskedEditBox1.TextChanged += RadMaskedEditBox1_TextChanged;
    radMaskedEditBox1.ValueChanged += RadMaskedEditBox1_ValueChanged;

    radMaskedEditBox1.Value = null;

}

private void RadMaskedEditBox1_ValueChanged(object sender, EventArgs e)
{
    Console.WriteLine(radMaskedEditBox1.Value);
}

- Type "1", you will notice that the value is still null.
- Type "2", the value is now correct.

Workaround:
private void RadMaskedEditBox1_ValueChanged(object sender, EventArgs e)
{
    if (radMaskedEditBox1.Text != "" )
    {
        var provider = radMaskedEditBox1.MaskedEditBoxElement.Provider;
        Console.WriteLine(provider.Value);
    }
    else
    {
        Console.WriteLine(radMaskedEditBox1.Value);
    }
  
}
er.Value);
Completed
Last Updated: 14 Jun 2018 14:43 by Dimitar
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
1 2 3 4 5 6