6 Answers, 1 is accepted
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
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
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
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
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
It works like a charm.
Thanks !