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

Huge dataset and Combobox Auto complete, causes lag.

1 Answer 191 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Nicklas
Top achievements
Rank 1
Nicklas asked on 09 Aug 2013, 11:36 AM
Hi!

I am unfortunately trying to load my user database into a radcombobox with autocomplete, I want to use the combobox only as a autocomplete textbox, not really as a Combobox with all its features.

Whenever it loads the data, it loads the entire table into the dataset and that is not something i want due to the lag, ive tried setting onLoadDemand and MinLength, to avoid the autocomplete, to load the entire dataset, without sucess. Ive also tried setting ItemsRequested="10" to make it load only 10 items at the time. Doesn't really seem to work that way.

Any idea? My control is currently looking like this:
                      <telerik:RadComboBox ID="UsersFromAD" runat="server" Width="256px"<br>
                             Height="100px" ShowDropDownOnTextboxClick="false"
                             MarkFirstMatch="True"
                             OnItemsRequested="ComboUsersFromAD_ItemsRequested"
                             EnableVirtualScrolling="True" ItemsPerRequest="10"
                             ShowMoreResultsBox="true" EnableLoadOnDemand="True"
                             Skin="Windows7">
                      </telerik:RadComboBox>

1 Answer, 1 is accepted

Sort by
0
Nicklas
Top achievements
Rank 1
answered on 09 Aug 2013, 12:09 PM
Think I actually managed to solve it, by not loading the data right the way. but having a SQL "like" query in the ItemsRequested event in the codebehind. Works out fine! And ive also set the limit of minimum 3 character, before accessing the databse, to avoid the massive lag with the help of a javascript, because the minimum length does not appear to work.

In the RadComboBox just set OnClientItemsRequesting to a javascript function such as:

 <script language="javascript" type="text/javascript">
function OnClientItemsRequesting(sender, eventArgs) {
    if (eventArgs.get_text().length < 4)
        eventArgs.set_cancel(true)
    else
        eventArgs.set_cancel(false);
}
</script>
Tags
ComboBox
Asked by
Nicklas
Top achievements
Rank 1
Answers by
Nicklas
Top achievements
Rank 1
Share this question
or