Is this scenario possible? - Selective use of Ajax

3 posts, 1 answers
  1. Boris
    Boris avatar
    289 posts
    Member since:
    Oct 2012

    Posted 21 May 2014 Link to this post

    I have a RadComboBox and other controls, including an ASP Repeater within a RadAjaxPanel.  
    The contents of the combo box are fairly typical, a list of numbers with -1 and blank text indicating that nothing has been selected.
    The repeater displays a list of bound RadButton check boxes.

    If the combo box has a valid value (> 0) selected, the server-side selected index changed event of the combo box calls a routine to repopulate the repeater, 

    If the combo box is set to -1 what I would like to happen is for the post back to be canceled and the most recent collection of controls in the repeater (and their checked values) to be retained, and the combo box itself to retain its -1 value.

    Is this possible?
  2. Answer
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 22 May 2014 in reply to Boris Link to this post

    Hi Boris,

    Please try to attach the OnClientSelectedIndexChanging event of RadComboBox and based on the selected item text cancel the event so that the server side event will not execute. Please have a look into the below JavaScript code snippet.

    function SelectionChange(sender, args) {
        if (args.get_item().get_text() == -1) {

    Let me know if you have any concern.
  3. Boris
    Boris avatar
    289 posts
    Member since:
    Oct 2012

    Posted 30 May 2014 in reply to Shinu Link to this post

    Actually they just changed the requirements so I can't try this, but I'll keep it in mind for future use.  

Back to Top