initiate load on demand

3 posts, 0 answers
  1. Merin
    Merin avatar
    14 posts
    Member since:
    Jul 2013

    Posted 26 Aug 2013 Link to this post


    I have a radcombo with load on demand enabled. But at some point I want to load items on a button click. So can I initiate a load on demand from code?

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 29 Aug 2013 Link to this post

    Hi Merin,

    You can use the requestItems client method to initiate a load-on-demand callback request with the specified text, causing the ItemsRequested server event to fire or a request to be sent to a web service. The second bool parameter instructs the RadComboBox to append the new items (True) or clear items (False). Please check the following code snippet.

    <script type="text/javascript">
        function OnClientClicked(sender, args) {
            var radcombobox = $find("<%= RadComboBox1.ClientID %>");
            radcombobox.requestItems("Item1", true);

  3. DevCraft R3 2016 release webinar banner
  4. Hristo Valyavicharski
    Hristo Valyavicharski avatar
    975 posts

    Posted 29 Aug 2013 Link to this post

    Hi Merin,

    When use LoadOnDemand items are not loaded initially. The ItemsRequested server event will be fired if the drop down is opened or if any text is typed in the combo's input. Usually in this event combo is populated  with data.  From code you could initially load items as call combo's requestItems() method in the pageLoad event. For example:
    <script type="text/javascript">
        function pageLoad() {
            var combo = $find('RadComboBox1');

    Hristo Valyavicharski
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Back to Top