Searching the RadListBox

2 posts, 0 answers
  1. Hoekstra
    Hoekstra avatar
    1 posts
    Member since:
    Jan 2011

    Posted 05 Aug 2011 Link to this post


    I want to build a RadListBox with loadOnDemand functionality. A requirement is that the scrollbar should be on the correct position, so in a box of 20k items, when scrolling to number 10k the scrollbar should be halfway. The dataset is available in the code-behind. So far so good.

    The thing is, I need to be able to do a search its items. The search should be fired to the server, where I can determine the current position or page of the listbox by doing a search on my dataset.
    For example in a separate textbox (or preferrably in some built in popup in the listbox) I want to do a search with text '200'. What should happen is the following; the listbox should load the first page with the first item beginning with '200'. The scrollbar of the listbox should still represent the current position of the total of records.

    Can you give me any directions how to implement this?


  2. Peter Filipov
    Peter Filipov avatar
    1028 posts

    Posted 10 Aug 2011 Link to this post

    Hello Hoekstra,

    Please use the following method getItemAsync to get an item from listbox when the load on demand is used. Here is a sample code how to select and scroll to a certain item:
    var listBox = $find("radListBox1");
            var item = listBox.getItemAsync(1000, function(item) { item.scrollIntoView (); item.set_selected(true);});

    You can use a web service to get the row number of the searched text.

    Peter Filipov
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Back to Top