This is a migrated thread and some comments may be shown as answers.

ASCX Control with combo box issue

4 Answers 64 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
dhuss
Top achievements
Rank 1
dhuss asked on 18 Sep 2012, 06:40 PM
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.

4 Answers, 1 is accepted

Sort by
0
Nencho
Telerik team
answered on 19 Sep 2012, 10:51 AM
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.
0
dhuss
Top achievements
Rank 1
answered on 19 Sep 2012, 01:42 PM
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.
0
Nencho
Telerik team
answered on 20 Sep 2012, 06:15 AM
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.
0
dhuss
Top achievements
Rank 1
answered on 20 Sep 2012, 02:47 PM
I have opened a support ticket so I can send you the zipped solution.
Tags
ComboBox
Asked by
dhuss
Top achievements
Rank 1
Answers by
Nencho
Telerik team
dhuss
Top achievements
Rank 1
Share this question
or