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

Applying a display template to autocomplete textbox

1 Answer 232 Views
AutoCompleteBox
This is a migrated thread and some comments may be shown as answers.
Arun
Top achievements
Rank 1
Arun asked on 21 Jul 2015, 05:06 AM

I am using the RadAutoCompleteBox for getting the user input.

i can also see the DropDownItemTemplate (which is used to put a template to the dropdownitems shown)...but I can't see/find anywhere a way to use a data template for the textbox ...after the users have made a selection.

 so for example... the drop down displays (Value : Display Name) and when the selection happens on the display name is shown...but i want to display the entire thing in the autocomplete textbox...

 is there any way i can acheieve this.

 

thanks and regards,

arun

1 Answer, 1 is accepted

Sort by
0
Accepted
Nasko
Telerik team
answered on 21 Jul 2015, 07:58 AM
Hello Arun,

In order to apply the exact same appearance for the items as the one in the DropDown as soon as a selection is made you need to apply a custom BoxesItemTemplate -  it is used to customize the way the items are rendered in the TextBox part of the control. We have created a sample project hat demonstrates how to apply such a Template and you could run and evaluate it. Please, notice that the BoxesItemTemplate is applied only whenever the control is in Multiple selection mode. If you are using Single selection mode the only approach that we could suggest you to achieve the desired is to override the ToString method of the custom class you use as a source for RadAutoCompleteBox.

By the end of the week we will add an article in our help documentation and an SDK example providing more detailed information about creating and applying BoxesItemTemplate.

Hopes this helps.

Regards,
Nasko
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
AutoCompleteBox
Asked by
Arun
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Share this question
or