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

Closing of Combo Box with Multi-Select Checkbox Items

4 Answers 236 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
darenkov
Top achievements
Rank 1
darenkov asked on 30 Mar 2010, 05:37 PM
Hi, I followed an example online of a multi-select combo box with a series of checkboxes in it. I am able to generate it and select multiple checkboxes but there is no mechanism for the user to close the combo box (unless perhaps clicking away from it.

Is there a way to do this that is obvious to the user, such as having a little link at the bottom of the combo window that says "close" or something similar?

4 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 31 Mar 2010, 08:21 AM

Hello,

One suggestion would be placing Label/Button control in FooterTemplate section of RadComboBox with onclick clicent event attached to it. In the onclick event handler, access the RadComboBox and hide the dropdown from code. Use the hideDropDown() method for cloing the dropdown.

aspx:

 
<telerik:RadComboBox ID="RadComboBox1">  
       . . .  
    <FooterTemplate>  
        <asp:Label ID="Label1" runat="server" Text="Close" onclick="CloseMe();"></asp:Label>  
    </FooterTemplate>  
</telerik:RadComboBox> 

javascript:

 
<script type="text/javascript">  
    function CloseMe() {  
        var combo = $find('<%= RadComboBox1.ClientID %>');  
        combo.hideDropDown();  
    }  
</script> 

-Shinu.

0
darenkov
Top achievements
Rank 1
answered on 02 Apr 2010, 06:10 PM
Thanks Shinu
0
Anumeha
Top achievements
Rank 1
answered on 12 Oct 2010, 07:04 PM
I am having a similar issue.

The CloseME function does not get called in my case. When i click the footer nothing happens.
Also, is it necessary to have the user click somewhere. Can the multi-select combobox behave like the other combos.

This is how my combo is declared:
<telerik:RadComboBox runat="server" ID="RadComboBox1" EnableLoadOnDemand="false"
                                Width="350px" OnPreRender="RadComboBox1_PreRender" AllowCustomText="true" Height="325px"
                                LoadingMessage="loading.." OnClientSelectedIndexChanging="OnClientSelectedIndexChanging"
                                 OnClientDropDownOpening="OnClientDropDownOpening"
                                OnClientDropDownClosing="OnClientDropDownClosing" OnClientBlur="OnClientBlur"
                                OnItemDataBound="RadComboBox1_ItemDataBound">
                                <ItemTemplate>
                                    <table>
                                        <tr>
                                            <td>
                                                <asp:CheckBox ID="CheckBox1" runat="server" onclick="stopPropagation(event, this);"
                                                    ToolTip="Adds as option" />
                                            </td>
                                            <td>
                                                <asp:RadioButton ID="RadioButton1" runat="server" GroupName="Type" onclick="SetUniqueRadioButton();"
                                                    ToolTip="Sets as default" />
                                            </td>
                                            <td>
                                                <%# DataBinder.Eval(Container.DataItem,"FullName") %>
                                            </td>
                                        </tr>
                                    </table>
                                </ItemTemplate>
                                <FooterTemplate>
                                    <asp:Label ID="Label1" runat="server" Text="Close" onclick="CloseMe();"></asp:Label>
                                </FooterTemplate                                  
                            </telerik:RadComboBox>
0
Kalina
Telerik team
answered on 19 Oct 2010, 03:36 AM
Hello Anumeha,

I am afraid that the code snippet provided is not sufficient for us to reproduce the issue.
Could you please paste here the full code of your page?
Thank you in advance.

Greetings,
Kalina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
ComboBox
Asked by
darenkov
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
darenkov
Top achievements
Rank 1
Anumeha
Top achievements
Rank 1
Kalina
Telerik team
Share this question
or