ASCX Control with combo box issue

5 posts, 0 answers
  1. dhuss
    dhuss avatar
    120 posts
    Member since:
    Sep 2009

    Posted 18 Sep 2012 Link to this post

    I have a custom ascx control that has a radComboBox. This is my code for the combo box and javascript code:
    <telerik:RadComboBox ID="radWQStatus" runat="server" AllowCustomText="false" Width="300px"
        DropDownWidth="350px" MaxHeight="300px" NoWrap="true" HighlightTemplatedItems="true"
        ExpandDirection="Down" ExpandDelay="0" CollapseDelay="0" CheckBoxes="true" EnableCheckAllItemsCheckBox="false"
        AutoPostBack="true" OnClientDropDownClosing="OnClientDropDownClosingWQS">
        <Items>
            <telerik:RadComboBoxItem runat="server" Text="Value1" Value="1" />
            <telerik:RadComboBoxItem runat="server" Text="Value2" Value="2" />
            <telerik:RadComboBoxItem runat="server" Text="Value3" Value="3" />
        </Items>
    </telerik:RadComboBox>


    <script type="text/javascript" language="javascript">
        function OnClientDropDownClosingWQS(sender, args)
            {
                if (args.get_domEvent().target == sender.get_imageDomElement()) {
                    args.set_cancel(false);
                }
                else {
                    args.set_cancel(true);
                }
            }
    </script>

    The problem I am having is the combo box keeps closing after each single selection. If I place this same code on a aspx page it works as expected, I can check multiple items before the box closes. What do I have to do to keep the combo box from closing when used in an ascx control place on an aspx page.
  2. Nencho
    Admin
    Nencho avatar
    1796 posts

    Posted 19 Sep 2012 Link to this post

    Hello Dennis,

    I have performed some tests with the provided snippet of code, but I was unable to replicate the experienced issue. Here is a video, demonstrating the behavior of the control at my end.
    Am I missing something?

    Greetings,
    Nencho
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. dhuss
    dhuss avatar
    120 posts
    Member since:
    Sep 2009

    Posted 19 Sep 2012 Link to this post

    I forgot to mention I have defined a public event in the ASCX control, ItemChecked. When postback occurs this event will fire if the parent page has code created for this event. The only other way I can get this to work the way I want is to not use the event and use a button to fire my code. Sorry for not including this bit of information.
  4. Nencho
    Admin
    Nencho avatar
    1796 posts

    Posted 20 Sep 2012 Link to this post

    Hello Dennis,

    Could you provide us the complete implementation that you use, so we could propose you a suitable solution for your scenario? 


    Greetings,
    Nencho
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  5. dhuss
    dhuss avatar
    120 posts
    Member since:
    Sep 2009

    Posted 20 Sep 2012 Link to this post

    I have opened a support ticket so I can send you the zipped solution.
Back to Top