This is a migrated thread and some comments may be shown as answers.

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

1 Answer 18 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Shahid
Top achievements
Rank 1
Shahid asked on 08 Mar 2011, 02:55 PM
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

1 Answer, 1 is accepted

Sort by
0
Dimitar Terziev
Telerik team
answered on 11 Mar 2011, 11:21 AM
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!
Tags
ComboBox
Asked by
Shahid
Top achievements
Rank 1
Answers by
Dimitar Terziev
Telerik team
Share this question
or