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

load on demand wcf client side tips and tricks required for data integrity

3 Answers 54 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Mac P
Top achievements
Rank 1
Mac P asked on 30 Jun 2010, 03:55 AM
Hello,
I want to avail the functionality to load on demand on the dropdown arrow click and just able to select the entire list item text because list item value is the id that is to be stored in database. AFter going through the documentation i realised that load on demand doesnt allow to select the entire list item text. So is there a trick or tip regarding how to avail this functionality as i dont want to display the text other than what is listed in dropdown. If there is trick that will allow to search on demand than that will be great but i am content if the first part of requirement is achieved.

Inshort
1) Populate combo box on load on demand
2) Allow entire combo box item to be selected. That way i can get id from selected value
3) When in edit mode prefill the combo box will the item that was saved to database.

Any help is greatly appreciated.
mac

3 Answers, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 06 Jul 2010, 12:23 PM
Hello Mac P,

You could achieve the first and second points from your requirements by doing the following:
  • Set the EnableLoadOnDemand property of the RadComboBox to false.
  • Handle the server-side ItemsRequested event and bind/load the Items in the RCB there.
  • Handle the client-side DropDownOpening event in this way:
    function onDropDownOpening(sender) {
        if (sender.get_items().get_count() == 0)
            sender.requestItems("", false);
    }
Finally, if you want to pre-load the Items in the RCB in a certain moment you could execute the same code as in the ItemsRequested event handler on the server.

I hope this helps.

Sincerely yours,
Simon
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Mac P
Top achievements
Rank 1
answered on 12 Jul 2010, 11:28 PM
Thanks for your response. I dont want to bind it on server side as i dont want to do any postbacks. Binding will be done on client side using WCF.

Is it possible to do it on client side? Will it preserve changes to server when i submit the request.?

Regards
Mac
0
Simon
Telerik team
answered on 14 Jul 2010, 01:14 PM
Hello Mac P,

Yes, you could Load On Demand through a WCF service as you would do with a normal Web Service. Please see this demo for a complete sample and this help article for a tutorial showing how to setup the service and the RadComboBox.

The changes, however, will not preserve after a postback and this is true for every Load On Demand approach.

I hope this helps.

Greetings,
Simon
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
ComboBox
Asked by
Mac P
Top achievements
Rank 1
Answers by
Simon
Telerik team
Mac P
Top achievements
Rank 1
Share this question
or