This is a migrated thread and some comments may be shown as answers.

Typing in RadCombobox with autocomplete is not working correctly

4 Answers 516 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Neil
Top achievements
Rank 1
Neil asked on 26 Feb 2020, 05:41 PM

     Hi,

     I've added a Radcombobox to a page in my .net project. I set the properties as follows:

            radCmbLocation.AllowCustomText = false;
            radCmbLocation.MarkFirstMatch = true;
            radCmbLocation.AutoCompleteSeparator = "-";

 I am filling the combo box with a number of sorted strings in the following format:

  01-01-04

All of the strings have this format.If I type "0" this appears:

01-01-01

This makes sense as it is the first string in the sort order. If I keep typing "1-02" (which cumulatively would be "01-02") the number in the combo box comes out as:

01-02-01-01

I was expecting that typing the "02" would have brought up the first 01-02 string in the drop down but that is not happening. Obviously I only want whatever I type to bring up the first match in the combobox but that is not happening. I been looking at posts on the combo box and auto-complete for a while and can't find an answer.

Any help would be appreciated.

Thanks,

fig

 

4 Answers, 1 is accepted

Sort by
0
Peter Milchev
Telerik team
answered on 02 Mar 2020, 02:58 PM

Hello,

Can you please provide a few dummy records so that we can get a better understanding of the exact reproduction steps and setup? 

It would be perfect if you share the items in markup as demonstrated below:

<telerik:RadComboBox ID="RadComboBox1" AllowCustomText="false" MarkFirstMatch="true"
    AutoCompleteSeparator="-" runat="server" RenderMode="Lightweight">
    <Items>
        <telerik:RadComboBoxItem Text="Item 1" />
        <telerik:RadComboBoxItem Text="Item 2" />
        <telerik:RadComboBoxItem Text="Item 3" />
        <telerik:RadComboBoxItem Text="Item 4" />
    </Items>
</telerik:RadComboBox>

You can also share a short video/screencast/screenshots demonstrating the behavior and more details of the expected one.

Regards,
Peter Milchev
Progress Telerik

Get quickly onboarded and successful with UI for ASP.NET AJAX with the Virtual Classroom technical trainings, available to all active customers. Learn More.
0
Neil
Top achievements
Rank 1
answered on 09 Mar 2020, 03:19 PM

Here is the closest I can come to your request. The dropdown in my app is really reading a table but I've taken some of the table records and put them in the dropdown as you asked.

<telerik:RadComboBox ID="RadComboBox1"AllowCustomText="false"MarkFirstMatch="true"
    AutoCompleteSeparator="-" runat="server" RenderMode="Lightweight">
    <Items>
        <telerik:RadComboBoxItem Text="01-01-01" />
        <telerik:RadComboBoxItem Text="01-01-02" />
        <telerik:RadComboBoxItem Text="01-01-03" />
        <telerik:RadComboBoxItem Text="01-01-04" />
        <telerik:RadComboBoxItem Text="01-01-05" />
        <telerik:RadComboBoxItem Text="01-01-06" />
        <telerik:RadComboBoxItem Text="01-01-07" />
        <telerik:RadComboBoxItem Text="01-01-08" />
        <telerik:RadComboBoxItem Text="01-02-01" />
        <telerik:RadComboBoxItem Text="01-02-02" />
        <telerik:RadComboBoxItem Text="01-02-03" />
        <telerik:RadComboBoxItem Text="01-02-04" />
        <telerik:RadComboBoxItem Text="01-02-05" />
        <telerik:RadComboBoxItem Text="01-02-06" />
        <telerik:RadComboBoxItem Text="01-02-07" />
        <telerik:RadComboBoxItem Text="01-02-08" />
        <telerik:RadComboBoxItem Text="01-03-01" />
        <telerik:RadComboBoxItem Text="01-03-02" />
        <telerik:RadComboBoxItem Text="01-03-03" />
        <telerik:RadComboBoxItem Text="01-03-04" />
        <telerik:RadComboBoxItem Text="01-03-05" />
    </Items>
</telerik:RadComboBox>


As you'll see from the attached screen shots I'm getting an odd result. Just to clarify, before I started typing when I created the screen shots I erased everything in the combo box.

My goal is to have a user type and whatever they type the highlighted choice in
The combo box reflects it. I’m not sure what is happening in the example
Above but I have found that there is usually something small with these
Controls that isn’t obvious. I’m trying to emulate the behavior of the
Standard .aspx .net dropdown but would prefer to use Telerik
For consistency. Telerik controls are usually more powerful.

Thanks,
Neil

0
Neil
Top achievements
Rank 1
answered on 10 Mar 2020, 04:11 PM

Just to clarify: I wish we could upload word files since I could insert information to describe the pngs I'm uploading.

The final png (03) I've just erased all the text in the combo box and then typed "01-02" and the result in the combo box is 01-02-01-01. I hope that's simpler and clearer.

0
Rumen
Telerik team
answered on 12 Mar 2020, 09:32 AM

Hi Neil,

You can define an AutoCompleteSeparator to allow the users to select several items and separate them using this predefined separator. In your case, you have specified the dash symbol as a separator, which means that every time the user types dash in the combo input, the item will be selected and separated from the previous one(s). 

From the provided screenshots and explanation I think that your scenario is different and you'd like an improvement in the autocomplete selection mechanism rather than separating the different selected items with a dash. That's why my advice is to remove the AutoCompleteSeparator="-" property or to set it to another symbol or list of symbols - AutoCompleteSeparator=";".

As to the selection, when you type in the input and search for some string when there is a match, the whole item text of the first match is displayed in the combobox input and the remaining not typed part is highlighted, .e.g.. 

 

This is similar to how the address bar of Google Chrome and Google Search Engine box work.

 

Thank you for your valuable feedback about the attachment functionality of the forum and allowed img extensions only -  we want to prevent our community from viruses and malicious software. If you'd like to attach zip files you can send us the Word file by opening a support ticket from your account. Thank you!

 

Regards,
Rumen
Progress Telerik

Get quickly onboarded and successful with UI for ASP.NET AJAX with the Virtual Classroom technical trainings, available to all active customers. Learn More.
Tags
Ajax
Asked by
Neil
Top achievements
Rank 1
Answers by
Peter Milchev
Telerik team
Neil
Top achievements
Rank 1
Rumen
Telerik team
Share this question
or