Reload from Web Services

11 posts, 1 answers
  1. Brian Mains
    Brian Mains avatar
    485 posts
    Member since:
    Oct 2008

    Posted 22 Sep 2009 Link to this post

    Hello,

    I have a combo that's bound to a web service.  When I click the drop down, it loads the list.  That's fine.  However, I want to refresh the binding with new data and new criteria.  Can I force a refresh?

    Thanks.
  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 23 Sep 2009 Link to this post

    Hello Brian,

    You can use requestItems client-side method of RadComboBox to send a request to the web service and reload the items.

    Kind regards,
    Yana
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Brian Mains
    Brian Mains avatar
    485 posts
    Member since:
    Oct 2008

    Posted 23 Sep 2009 Link to this post

    Hello,

    Yes, thanks.  That method takes two parameters though, and I wasn't sure what to pass to this, when doing it manually.  Any recommendations?

    Thanks.
  5. Answer
    Simon
    Admin
    Simon avatar
    2281 posts

    Posted 23 Sep 2009 Link to this post

    Hi Brian Mains,

    Here is the requestItems method description taken from the client-side reference of the RadComboBox object:

    "Initiates 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 WebService. The second bool parameter instructs the combobox to append the new items (true) or clear items (false)."

    So, in your case you can set the second parameter to false to make sure that new Items are loaded.

    Regards,
    Simon
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  6. Brian Mains
    Brian Mains avatar
    485 posts
    Member since:
    Oct 2008

    Posted 23 Sep 2009 Link to this post

    Thanks, that helps.  I'll use that then.
  7. Brian Mains
    Brian Mains avatar
    485 posts
    Member since:
    Oct 2008

    Posted 24 Sep 2009 Link to this post

    Hello,

    One slight repercussion... when the web service has never loaded the data items, requestItems doesn't appear to refresh the list... is that true, or may there be some other repercussion?

    Thanks.
  8. Brian Mains
    Brian Mains avatar
    485 posts
    Member since:
    Oct 2008

    Posted 24 Sep 2009 Link to this post

    The underlying issue is I need to set the value so that the new value appears.  It's not doing that, so I don't know how to ensure that the combo loads the new items, then selects one of these new items (which weren't there before)...  I'm really confused by this all...
  9. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 25 Sep 2009 Link to this post

    Hello Brian Mains,

    You can handle the ItemsRequested client-side event and then select the first Item from the list of all loaded Items (if any), e.g.

    function onItemsRequested(sender) { 
        if (sender.get_items().get_count() > 0) 
            sender.get_items().getItem(0).select(); 

    Kind regards,
    Simon
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  10. mark baer
    mark baer avatar
    142 posts
    Member since:
    Sep 2009

    Posted 18 Mar 2011 Link to this post

    I don't see this method reference anywhere.  When my control loads, the Radcombobox calls the service and loads just fine.  But when the selectedIndexChanged takes effect, it loads the text/value into a textbox where I can change it.  When I click "Save", I want the radcombobox to reload, preferably from the server side, but I'll load it from the client if I need to.  I just don't see how I can get that done.

    thanks
  11. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 23 Mar 2011 Link to this post

    Hello mark baer,

    Your requirement is rather specific and in order to help you implement it we will need a more thorough description. A sample project showing where you are currently up to will further speed up the process.

    If you can, please send us such a project via a support ticket and/or provide the requirement description.

    Regards,
    Simon
    the Telerik team
  12. arash
    arash avatar
    5 posts
    Member since:
    Jun 2007

    Posted 22 Dec 2012 Link to this post

    Load RadComboBox items from web service

    telerik:RadComboBoxID="ddlPersonFullName" runat="server" ValidationGroup="Driver"
                                EnableItemCaching="true" EnableLoadOnDemand="true" WebServiceSettingsPath="~/ComboWebService.asmx"
                                WebServiceSettingsMethod="GetPerson" ShowMoreResultsBox="true" EnableVirtualScrolling="true"
                                ItemsPerRequest="100" OnMoreClick="ddlPersonFullName_MoreClick" OnClientItemsRequested="OnClientItemsRequested"

    and

    <telerik:RadScriptBlock runat="Server" ID="RadScriptBlock1">
        <script type="text/javascript">
            function OnClientItemsRequested(sender, eventArgs) {
                sender.set_endOfItems(false);
            }
        </script>
    </telerik:RadScriptBlock>

    after I add new item to web service without refresh page don't load in redcombobox
    can help me please?
    can you insert sample code for this
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017