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

Questions about LoadOnDemand

1 Answer 67 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
CSurieux
Top achievements
Rank 2
CSurieux asked on 29 Oct 2008, 01:47 PM
Hello,

I am using load on demand with 3 radcomboboxes, just as the telerik sample, but I have problems because my last combo needs the 1st and 2nd combos selected values and it appear that when inside the ItemRequested handler I have no access to my fist combo selected value ( I get string.empty) and  Viewstate is still no available (I saved the 1st slected value in viewstate, but get string.empty trying to get it back).
So what is the lifecycle for this event ?
Is it triggered before Viewstate is loaded for page ?
Is this the reason why you added the context feature, I will try it.

Second question concerns exceptions handling: when an exception occurs inside the ItemRequested, it is sent to client and I get an alert with my exception text.
Well done but I DO NOT want this, I dont want that radCombobox handles the exception but want it to be passed it upwards where it will be catched by my general handler.
Is there a way to obtain this last process.

Thanks for answer.
CS

1 Answer, 1 is accepted

Sort by
0
Rosi
Telerik team
answered on 29 Oct 2008, 02:15 PM
Hello Christian Surieux,

The reason for the problem is that ItemsRequested event is a result of a callback. And when it is executed the ViewState is not loaded yet. And yes,that is the reason why the Context property is implemented.

Please follow the article for more details : Passing Context Information to the Server

As for the second problem -you can use try-catch block to catch the exception in the ItemsRequested event.

Also you subscribe to the OnClientItemsRequestFailed event of RadComboBox and  hide the default error message that appears in the combobox and display your own message instead

Hope this helps.

Regards,
Rosi
the Telerik team

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