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

Reload from Web Services

10 Answers 185 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Brian Mains
Top achievements
Rank 1
Brian Mains asked on 22 Sep 2009, 01:16 PM
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.

10 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 23 Sep 2009, 01:44 PM
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.
0
Brian Mains
Top achievements
Rank 1
answered on 23 Sep 2009, 03:05 PM
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.
0
Accepted
Simon
Telerik team
answered on 23 Sep 2009, 03:32 PM
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.
0
Brian Mains
Top achievements
Rank 1
answered on 23 Sep 2009, 04:03 PM
Thanks, that helps.  I'll use that then.
0
Brian Mains
Top achievements
Rank 1
answered on 24 Sep 2009, 02:47 PM
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.
0
Brian Mains
Top achievements
Rank 1
answered on 24 Sep 2009, 03:30 PM
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...
0
Simon
Telerik team
answered on 25 Sep 2009, 01:37 PM
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.
0
mark baer
Top achievements
Rank 1
answered on 18 Mar 2011, 10:20 PM
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
0
Simon
Telerik team
answered on 23 Mar 2011, 04:16 PM
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
0
arash
Top achievements
Rank 1
answered on 22 Dec 2012, 10:40 AM
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
Tags
ComboBox
Asked by
Brian Mains
Top achievements
Rank 1
Answers by
Yana
Telerik team
Brian Mains
Top achievements
Rank 1
Simon
Telerik team
mark baer
Top achievements
Rank 1
arash
Top achievements
Rank 1
Share this question
or