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

Multiple delimiter for RadAutoCompleteBox

6 Answers 232 Views
AutoCompleteBox
This is a migrated thread and some comments may be shown as answers.
Vannick
Top achievements
Rank 1
Vannick asked on 29 Dec 2017, 05:46 AM

Hi,

The delimiter is a char attribute in RadAutoCompleteBox.

Is it possible to have multiple delimiter (like space and enter) ?

If yes how?

Thanks a lot

6 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 29 Dec 2017, 09:17 AM
Hello, Vannick, 

Thank you for writing.  

Currently, RadAutoCompleteBox supports only one delimiter. However, we already have a similar feature request logged in our feedback portal. You can track its progress, subscribe for status changes and add your comments on the following link - feedback item.

I hope this information helps. Should you have further questions I would be glad to help.
 
Regards,
Dess
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Vannick
Top achievements
Rank 1
answered on 03 Jan 2018, 11:20 AM

Ok, thanks for the information.

An other question, is it possible to set the delimiter to the key 'Enter'. I have tried something like that but it does not seems to work:

this.radAutoCompleteBoxTags.Delimiter = '\r';

Thanks for the info

 

 

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 03 Jan 2018, 12:42 PM
Hello, Vannick, 

Thank you for writing back. 

When you start typing in RadAutocompleteBox, a popup with suggestions will be shown. If you press the Enter key, the selected item will be added as a token. The Text property will be updated accordingly containing all tokens separated by the delimiter. Here is a sample code snippet how to assign the Enter key as a delimiter: 
this.radAutoCompleteBox1.AutoCompleteDataSource = this.customersBindingSource;
this.radAutoCompleteBox1.AutoCompleteDisplayMember = "ContactName";
this.radAutoCompleteBox1.Delimiter = (char)Keys.Enter;

I hope this information helps. If you have any additional questions, please let me know. 

 Regards,
Dess
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Vannick
Top achievements
Rank 1
answered on 04 Jan 2018, 05:41 AM

Yes I know what you means, however I am afraid this is not exactly what I want.

Let's imagine, we have an autocomplete than can contains multiple items, what i would like it that each time i press Enter, a new token is created (even if my token is not present in the auto complete data source).

I put an attachment what his the behaviour on my side. You can see that instead to create a new token, the text entered is selected.

How to create a new token by just pressing Enter (like if I press ';')

Thanks a lot, I hope I am clear

 

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 04 Jan 2018, 09:42 AM
Hello, Vannick, 

Thank you for writing back. 

The provided clarification is greatly appreciated. It helped me better understand your requirement. You can leave the default delimiter in this case. Just handle the TextBoxElement.KeyPress event and make the custom text a token. Here is a sample code snippet which result is illustrated in the attached gif file: 
this.radAutoCompleteBox1.TextBoxElement.KeyPress += TextBoxElement_KeyPress;

private void TextBoxElement_KeyPress(object sender, KeyPressEventArgs e)
{
    if (e.KeyChar == (char)Keys.Enter)
    {
        this.radAutoCompleteBox1.Text = this.radAutoCompleteBox1.Text + ";";
        this.radAutoCompleteBox1.TextBoxElement.SelectionStart = this.radAutoCompleteBox1.Text.Length;
    }
}

I hope this information helps. If you have any additional questions, please let me know. 

 Regards,
Dess
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Vannick
Top achievements
Rank 1
answered on 06 Jan 2018, 09:00 AM

It works like a charm.

Thanks !

Tags
AutoCompleteBox
Asked by
Vannick
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Vannick
Top achievements
Rank 1
Share this question
or