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

ClientDataString cause the Items Requested event to be called only once

3 Answers 73 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
samer
Top achievements
Rank 1
samer asked on 30 Jul 2008, 06:50 AM
Hi,

I read the article about using the CliendDataString to pass values from the client to the server side when combo box Item requested is fired. Im trying to use the same thing on two dependant combo boxes that both use load on demand feature via the item requested event. the second combo box items are dependant on the item selected in the first combo box, so when the an item selected in the first combo box I set the ClientDataString to the appropriate value, so when I drop the second combo it uses the "e.ClientDataString" to populate the items, and that works correctly for first time. However when I re select new value in the first combo then drop the second combo, it does not call the items requested event again. And the items from the first load are still there which is incorrect, so why is that happenning? and how to set it up , so whenever the second combo is droped it will call the items requested event to populate the items?

Thanks for the help

3 Answers, 1 is accepted

Sort by
0
Rosi
Telerik team
answered on 30 Jul 2008, 09:01 AM
Hello Samer,

Please find the attached project illustrating that everything works as expected at our side.

I suggest you modify it so the problem to appear and open a support ticket and send it back to us.

Regards,
Rosi
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
samer
Top achievements
Rank 1
answered on 31 Jul 2008, 03:30 PM
Hi,

Thanks for your reply. I was able to resolve the problem based on the example you provided in the response. However my observation about having the "ItemsRequested"event to be fired only once when using the "ClientDataString" to pass parameters from the client to the server side is still true, as also presented in your documetation example about using ClientDataString in this link "http://www.telerik.com/help/aspnet/combobox/combobox_clientdatastring.html", you can verify that by setting a break point to the ItemsRequested Event and you will notice that its only going to be fired once.
The Reason that the zipped project you provided is working fine, is because in the javascript you are explicitly calling "RequestingItems(String text, Boolean) each time new value is set in the parent combo box, which causes the ItemsRequested event to be fired, and that is what Im using right now, and it works fine. I just wanted to report that incase this issue is a bug, and I apprecaite if you let me know about your finding.

Thanks again
0
Rosi
Telerik team
answered on 01 Aug 2008, 07:59 AM
Hi Samer,

Thank you for the link. I understand the problem now.

This behavior is not related with the ClientDataString. By design if the combobox has an items when you open it the request will not be sent to the server. You can change this by hooking on the OnClientDropDownOpening event and call the RequestItems method.

You can see the attached project for more details.

All the best,
Rosi
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
ComboBox
Asked by
samer
Top achievements
Rank 1
Answers by
Rosi
Telerik team
samer
Top achievements
Rank 1
Share this question
or