How to trigger Ajax load of a RadComboBox and select the first item loaded.

2 posts, 0 answers
  1. Richard
    Richard avatar
    27 posts
    Member since:
    Sep 2008

    Posted 12 Apr 2010 Link to this post

    Hi,

    After looking at the doc, I can't find all the hooks I need for a seemingly logical scenario: I have many RadComboBoxes on a page, and I need to load one or the other of them via client "onclick" events. For example, when a user clicks a checkbox, I need to load a related RadComboBox and also set the selected index to the first item loaded. I cant expect the user to check the checkbox and then also click on the RadComboBox to trigger it. Does anybody have an example or a tip how to do this? The easy part is the Ajax loading, the difficult part seems to be: fire and event to get the RadComboBox to start its ajax loading and also set the first item as selected in the ComboBox.

    I have seen this post:
    http://www.telerik.com/community/forums/aspnet-ajax/combobox/ajax-refresh-of-radcombobox.aspx

    but aside from being very complex for a simple scenario (which I could live with), it doesn't work :-) No matter where I put the AjaxManager etc on my (non trivial) page, I get:
    Please, see whether wrapping the code block, generating the exception, within RadCodeBlock resolves the error. ---> System.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
    eb.UI.ControlCollection.AddAt(Int32 index, Control child)....
    Web.UI.RadAjaxControl.MoveUpdatePanel(Control initiator, Control updated)
    inner exception stack trace ---
    Web.UI.RadAjaxControl.MoveUpdatePanel(Control initiator, Control updated)
    ...

    It is wrapped, of course, just as in the example presented...


    THANKS!
    Richard
  2. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 13 Apr 2010 Link to this post

    Hello Richard,

    I have just replied to your support thread:

    Please find attached a sample page. It contains two comboboxes and two checkboxes.

    Checking the first checkbox will load the items on demand of the first combo and will select the first item.
    Checking the second checkbox will load the items to the second combo with ajax (using RadAjaxManager).

    Link with the page.

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