call ItemsRequested onfocus

3 posts, 1 answers
  1. Dan Lehmann
    Dan Lehmann avatar
    103 posts
    Member since:
    May 2011

    Posted 23 Aug 2011 Link to this post

    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. Answer
    Ivana
    Admin
    Ivana avatar
    657 posts

    Posted 24 Aug 2011 Link to this post

    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 >>

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Dan Lehmann
    Dan Lehmann avatar
    103 posts
    Member since:
    May 2011

    Posted 24 Aug 2011 Link to this post

    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);
    }
Back to Top