Huge dataset and Combobox Auto complete, causes lag.

2 posts, 0 answers
  1. Nicklas
    Nicklas avatar
    16 posts
    Member since:
    Mar 2012

    Posted 09 Aug 2013 Link to this post

    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>
  2. Nicklas
    Nicklas avatar
    16 posts
    Member since:
    Mar 2012

    Posted 09 Aug 2013 Link to this post

    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>
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top