Prevent RadComboBox closing after checkbox item has been clicked (codebehind)

4 posts, 1 answers
  1. A W
    A W avatar
    4 posts
    Member since:
    Jan 2010

    Posted 10 Jun 2010 Link to this post

    I have created a custrom combobox with checkboxes in codebehind, as detailed in my blog post here:

    This works well, but I can't seem to apply the correct Javascript in order to prevent the RadComboBox closing directly after a checkbox has been clicked.

    Can anyone tell me how to use Javascript to achieve this? (something like the Telerik StopPropagation() example)

    Many thanks in advance!

    Andrew Whitten
  2. Answer
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 11 Jun 2010 Link to this post

    Hello Andrew,

    Have you tried attaching 'OnClientDropDownClosing' To RadComboBox? Cancel the event using args.set_cancel(true) method if clicked on checkbox, otherwise do not execute the code args.set_cancel(true), which in turn closes the dropdown.

  3. A W
    A W avatar
    4 posts
    Member since:
    Jan 2010

    Posted 12 Jun 2010 Link to this post

    Thanks Princy!

    Here is the exact script I ended up using (based on your advice)

    function OnClientDropDownClosing(sender, eventArgs) { if( eventArgs.get_domEvent().type == 'click' ) { eventArgs.set_cancel(true);  } }

    It seems to work for me, since all mouse clicks outside of the combobox have the DOM event of 'mousedown'.
  4. Smiely
    Smiely avatar
    129 posts
    Member since:
    Nov 2010

    Posted 18 Feb 2011 Link to this post

    Hi Princy

    I am having similar problem. I have a tree in a RadCombox and that tree is loading on demand. when I click on a node, combobox is closing. For loading the tree I am using code-behind. How can I make ComboBox remain open untill I make my selction ? That StopPropagation  is not working for me.

    Please help,
Back to Top