Questions about LoadOnDemand

2 posts, 0 answers
  1. CSurieux
    CSurieux avatar
    465 posts
    Member since:
    Jan 2007

    Posted 29 Oct 2008 Link to this post

    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
  2. Rosi
    Admin
    Rosi avatar
    2527 posts

    Posted 29 Oct 2008 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top