Sean M. Severson
5 Answers, 1 is accepted
Please find attached a sample project. Just start typing in the RadTextBox and it will automatically search and select the listbox item that matches.
Regards,
Veselin Vasilev
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Veselin,
Thank you for the example. I was able to modify it to work for most of what I need. I modified the javascript to get the key pressed by the user and added an attribute, onkeypress, to the RadListBox on my form.
Here is the Javascript I used...
function filterListBox(sender, e) {
var list = $find("<%= lstUser.ClientID %>");
var searchText = String.fromCharCode(event.keyCode);
var items = list.get_items();
for (var i = 0; i < items.get_count(); i++) {
var item = items.getItem(i);
if (item.get_text().toLowerCase().startsWith(searchText.toLowerCase())) {
item.select();
}
}
}
Now, instead of selecting all of the items, I need to scroll to the first item that matches.
Sean M. Severson
Sean M. Severson