LoadOnDemand is not initiated from combo dropdown opne if the combo has already any item present.

2 posts, 0 answers
  1. Shahid
    Shahid avatar
    12 posts
    Member since:
    May 2009

    Posted 08 Mar 2011 Link to this post

    We have a load-on-Demand combo which is working as expected for all the scenario except this one.

    For a combo with no items in it, drop down opens and it calls ItemRequestedHandler which is fine. Now if I click on the combo again, this time drop down opens but ItemRequestedHandler is not called.

    on the contrary if we write any text using keyboard, while the focus is on this combo,  ItemRequestHandler is always called ( for a blank combo as well as for a combo which already have an item)

    We want the same functionality i.e calling ItemRequestHandler even if we mouse click to open the drop down for a combo which already has item present in it

  2. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1268 posts

    Posted 11 Mar 2011 Link to this post

    Hello Shahid,

    What you are experiencing is the default behavior of the combobox when Load on Demand is used. The ItemsRequested event occurs when the EnabledLoadOnDemand property is True and the user types text into the input field or clicks on the drop-down toggle image when the list is empty.

    To fulfil your requirements my suggestion is to subscribe on the OnClientDropDownOpening event of the combobox, which is fired when it's about to expand. In the event handler for this event you should call the requestItems client side method of the combobobox, which will initiate request and the ItemRequested event will be fired. The implementation of the OnClientDropDownOpening event handler should be as following:
    function OnClientDrowDownOpeningEventHandler(sender, args) {
     
         
        var inputParameter = "some value";
        sender.requestItems(inpitParameter, false);
     }

    Regards,
    Dimitar Terziev
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Back to Top