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

call ItemsRequested onfocus

2 Answers 81 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Dan Lehmann
Top achievements
Rank 1
Dan Lehmann asked on 23 Aug 2011, 11:20 PM
Hi,
I have 2 'google suggest' style RadComboBox with EnableLoadOnDemand="true". Is there an easy way to call the OnItemsRequested function every time the ComboBox gets focus?

I get the items the first time the ComboBox receives focus and if I start typing but the problem I have is the following:
1. I type something in ComboBox1.
2. I click in ComboBox2 and see filtered items based on ComboBox1.
3. I type something else in ComboBox1.
4. I click in ComboBox2 again and the old filtered items are there. It does not make another call to the codebehind handler for OnItemsRequested until I type something.

Thanks,
Dan

2 Answers, 1 is accepted

Sort by
0
Accepted
Ivana
Telerik team
answered on 24 Aug 2011, 12:16 PM
Hello Dan,

Try using the OnClientFocus event to make a call to the requestItems(string, boolean) method for that.
It is going to make the call to OnItemsRequested server-side event handler every time the ComboBox gets focus.

Here you can find more about using the requestItems method.

Regards,
Ivana
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Dan Lehmann
Top achievements
Rank 1
answered on 24 Aug 2011, 02:41 PM
Thanks, that works!

In my RadComboBox I added:  OnClientFocus="clientRequestItems"
which calls my js fn:
function clientRequestItems(sender, args) {
    sender.requestItems(sender.get_value(), false);
}
Tags
ComboBox
Asked by
Dan Lehmann
Top achievements
Rank 1
Answers by
Ivana
Telerik team
Dan Lehmann
Top achievements
Rank 1
Share this question
or