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

Populate and display dropdown on page load

2 Answers 196 Views
AutoCompleteBox
This is a migrated thread and some comments may be shown as answers.
Francois MARTIN
Top achievements
Rank 2
Francois MARTIN asked on 19 Sep 2014, 07:47 AM

Hello Folks,

I do know that the AutoCompleteBox has been designed to display its DropDown upon a user entry and not before. But this behavior does eventually create a little confusion when the user has no idea what the possibilities are. Therefore I would like to achieve the following functionality:

  1. Populate the dropdown immediately with a maximum of 100 elements
  2. Display the dropdown at load time after being populated with the 100 elements
  3. Upon user entry, the filtering should happen on all possible elements, not only the 100 elements that were preloaded

I am aware that the RadComboBox with the LoadOnDemand event could come close to the solution,... but close isn't enough. I would really like to use the AutoCompleteBox. Any idea how to achieve this ?
Thanks

2 Answers, 1 is accepted

Sort by
0
Accepted
Nencho
Telerik team
answered on 23 Sep 2014, 02:10 PM
Hello Francois,

I would suggest you to use a WebService to bind the RadAutoComplteBox with data and use the private method _requestItems("") at page load (at client-side). Thus you will manually initiate request to the web service and populate the control initially with the needed data. This approach will provide you with the ability to customize the queries to the database and return the needed results  - initially 100 and then filtering against the entire datasource.

In addition in the attachment you could find a simple project, demonstrating the implementation of the above suggestion. The thing you need to modify is the access to your database and the needed filtering.


Regards,
Nencho
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Francois MARTIN
Top achievements
Rank 2
answered on 23 Sep 2014, 04:57 PM
Brilliant, this is exactly what I was looking for!
Thank you.
Tags
AutoCompleteBox
Asked by
Francois MARTIN
Top achievements
Rank 2
Answers by
Nencho
Telerik team
Francois MARTIN
Top achievements
Rank 2
Share this question
or