Combo loadon demand problem

3 posts, 0 answers
  1. vairam
    vairam avatar
    85 posts
    Member since:
    May 2008

    Posted 02 Mar 2009 Link to this post


    I am loading the combo ondemand .If i type 'A' in the combo's text box  the first 10 results are coming in the drop down list with scroll bar.In the bottom its showing 1-10 out of 55 items.But if i scroll down the drop down list still first 10 records only displaying it's not going to the next 10.Because the first item has selected automatically when i type somting in the combo.If the result is more than 10 records and then scroll down nothing will be happened.what i needs to do?
  2. kmccusker
    kmccusker avatar
    11 posts
    Member since:
    Sep 2006

    Posted 02 Mar 2009 Link to this post

    Hi Vairam,

    Could you provide a code sample demonstrating this issue?
  3. Nathan J Pledger
    Nathan J Pledger avatar
    95 posts
    Member since:
    Apr 2006

    Posted 04 Mar 2009 Link to this post

    Hi Vairam,

    I've just had this problem too. I was being a bit dumb, though, but I still don;t understand what was happening.

    I had the Filter property set to "Contains" and was using LoadOnDemand. However, my backend was already filtering the results, which were coming back correctly. When they were populated in the ItemsRequested event, they all went in, but didn't appear on the combo box - just the counts, as you say. I realised my error, and set Filter to "None", it now works faster and the correct number of results is displayed in the drop down portion.

    Even though I was accientally Filtering the text twice (with the same expression), I would have still expected the items to be displayed, but maybe that's something Telerik could explain.

    My code, btw, if it should help:

        <telerik:RadComboBox ID="radSearchComboBox" runat="server"  
                                LoadingMessage="...Searching ..."  
                                OnClientItemsRequesting="radSearchComboBox_OnClientItemsRequesting"  />                                                      

    void _radSearchComboBox_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e) 
                DateTime startTimestamp = DateTime.Now; 
                RadComboBox radComboBox = (RadComboBox)o; 
                int itemsPerRequest = 20; 
                int itemOffset = e.NumberOfItems; 
                int endOffset = itemOffset + itemsPerRequest; 
                using ( .... ) 
    // code removed for clarity and IP 
                    ISearchResult[] searchResults=searchHandler.Search(); 
                    if (searchResults.Length == 0) 
                        e.Message = "No matching items"
                        if (endOffset > searchResults.Length) endOffset = searchResults.Length; 
                        for (int i = itemOffset; i < endOffset; i++) 
                            ISearchResult searchResult = searchResults[i]; 
                                RadComboBoxItem item = new RadComboBoxItem(searchResult.Caption); 
                        DateTime endTimeStamp = DateTime.Now; 
                        e.Message = "Showing <strong>1</strong>-<strong>" + endOffset.ToString("#,##0") + "</strong> out of " + searchResults.Length.ToString("#,##0") + " results ("+endTimeStamp.Subtract(startTimestamp).Milliseconds.ToString("#,##0")+"ms)"

Back to Top