Dropdown closing even after set_cancel(true)

2 posts, 0 answers
  1. Joseph
    Joseph avatar
    21 posts
    Member since:
    Mar 2013

    Posted 21 Sep 2013 Link to this post

    I added a RadCombobox to my page and wrote code to disable closing of the dropdown based on some condition. The issue is that the drop down is getting closed immediately after selecting an item. The 'Checkboxes' are enabled and after checking two items only the drop down should close. I have added args.set_cancel(true) in the OnClientDropDownClosing event which seems not working. Later I removed all the business logic inside that event and wrote args.set_cancel(true) and the same result is happening. So I guess the issue is not related to the logic I implemented.

    Any input?
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 21 Sep 2013 Link to this post

    Hi Joseph,

    I am not able to replicate the issue. For me args.set_cancel(true) is working properly. Please have a look at the following code that I have tried which works fine at my end.

    <telerik:RadComboBox ID="RadComboBox1" runat="server" CheckBoxes="true" OnClientDropDownClosing="OnClientDropDownClosing1">
            <telerik:RadComboBoxItem Text="Item1" runat="server" />
            <telerik:RadComboBoxItem Text="Item2" runat="server" />
            <telerik:RadComboBoxItem Text="Item3" runat="server" />

    <script type="text/javascript">
        function OnClientDropDownClosing1(sender, args) {
            var count = sender.get_checkedItems().length; // count of checked items
            if (count != 2) {
                alert("Select 2 items");

  3. DevCraft R3 2016 release webinar banner
Back to Top