Our lists typically render a using a parttern using "code" - "value" so the Autocomplete looks perfect since it allows the users who know their list values to quickly enter them via the keyboard without needing to click entries in the list itself.
The one down side is that I can't see a way of forcing the drop down list to display - e.g. for users that don't know any of the list entries and want to show the full list of available options.
Is this possible or something that could be introduced in future?
Is there a way to allow the user to make multiple selection (e.g. by using the Ctrl key) without needing to open up the list multiple times?
8 Answers, 1 is accepted
Autocomplete UI component in general is a textbox with a list of suggestions. That is why the component does not have button for opening this list.
You can open suggestions list with current Client API of the component. For instance you can add button next to the autocomplete UI component and wire click event in order to open list:
function
buttonClicked(e) {
$(
'#autocomplete'
).data(
'tAutocomplete'
).open();
}
Georgi Krustev
the Telerik team
That gets me part way there - now I just need your magic wands to allow multi-select on the list itself when it is open!
Thanks again for the quick response.
You can rebind list when you need to open explicitly open it. Something like this:
autocomplete.dataBind(autocomplete.data,
true
)
Georgi Krustev
the Telerik team

function buttonClicked(e) {
$('#City').data('tAutoComplete'
).open();
}
<input type="button" value=">>" onclick="buttonClicked()" />
@(Html.Telerik().AutoCompleteFor(m => m.City)
.Name(
"City")
.Encode(false)
.ClientEvents(events => {events.OnDataBinding("City_AutoComplete");})
.DataBinding(a => a.Ajax().Select("CityList", "Controller"))
.AutoFill(true)
.HighlightFirstMatch(true)
.HtmlAttributes(new { style = string.Format("width:{0}px", 320) })
)
This error is raised because AutoComplete component does not have any data in the moment when the open() method is called. I have fixed this limitation in order to avoid this issue.
For your convenience I have attached the modified JavaScript file.
Georgi Krustev
the Telerik team

