Reload RadComboBox on changing of other asp form elements

6 posts, 0 answers
  1. Conor
    Conor avatar
    4 posts
    Member since:
    Mar 2012

    Posted 24 Nov 2014 Link to this post

    I'm trying to get a RadComboBox to reload when any of 5 .asp form elements in the page are changed.

    For example, I have an asp textbox calender, which, if changed, I want to trigger a reload of a RadComboBox as a change of date changes availability of the options in the combobox.

    Is there a simple way of doing this using, say the "onchange" function in the asp form element? Any assistance on the simplest method to achieve this would be welcome.

    Thanks in advance.
  2. Conor
    Conor avatar
    4 posts
    Member since:
    Mar 2012

    Posted 24 Nov 2014 in reply to Conor Link to this post

    In case it makes a difference, this RCB is being populated by a web service.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    1746 posts

    Posted 27 Nov 2014 Link to this post

    Hello,

    I would like to clarify that the change event is fired for <input>, <select>, and <textarea> elements when a change to the element's value is committed by the user.

    In this case I would suggest subscribing for each control's client event that is fired when user interaction with the control occurs and request the RadComboBox items. You can do that by calling the RadComboBox client-side object requestItems method as explained in this help article.

    Regards,
    Boyan Dimitrov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  5. Conor
    Conor avatar
    4 posts
    Member since:
    Mar 2012

    Posted 28 Nov 2014 in reply to Boyan Dimitrov Link to this post

    Thanks for the reply.

    I've implemented an onchange function in the asp form elements to call a function when the field is changed, I'm just having difficulty getting the function that fires a reload of the RCB to work.

    If my RCB is called myRadComboBox - what do I need to do to this?

    <script language="javascript" type="text/javascript">
     function myReloadFunction() {
         var combo = $find(myRadComboBox);
         combo.requestItems();
     }
     </script>

    Thanks!
  6. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    1746 posts

    Posted 03 Dec 2014 Link to this post

    Hello,

    You can pass an empty string in order to request all items from the web service.
    //code
    combo.requestItems("", true);


    Regards,
    Boyan Dimitrov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  7. Conor
    Conor avatar
    4 posts
    Member since:
    Mar 2012

    Posted 03 Dec 2014 in reply to Boyan Dimitrov Link to this post

    Many thanks, Boyan.

    I actually got it working last night - using the empty string you've just suggested.

    Conor
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017