Last Updated: 15 Jul 2019 08:33 by ADMIN
Release R3 2019 (LIB 2019.2.722)
Created on: 19 Apr 2019 13:30
Category: Editors
Type: Bug Report
Bug in Autocompletebox with SelectionChanged-event



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)
    End Sub
End Class

Posted on: 23 Apr 2019 06:52

Hi Dess,

Thanks for the .SelectedText solution.

We will use this approach instead of the .SelectionStart/.SelectionLength approach.

Best regards


Dess | Tech Support Engineer, Principal
Posted on: 22 Apr 2019 12:17
Hello, Patrick,    

The provided code snippet and sample screenshot are greatly appreciated. Indeed, the selection is with line number symbols offset to the right on the lines after the first one.

I have also updated your Telerik points.

Currently, the possible solution that I can suggest is to the RadAutoCompleteBox.SelectedText if you want to extract the selected text.

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Dess | Tech Support Engineer, Sr.
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Attached Files: