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

CheckBoxes enhancment req

1 Answer 47 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Jody Harbour
Top achievements
Rank 1
Jody Harbour asked on 30 Sep 2011, 09:37 PM
when using checkboxs if you have a item set to isseperator then remove the checkbox from that option.

1 Answer, 1 is accepted

Sort by
0
Kalina
Telerik team
answered on 05 Oct 2011, 09:24 AM
Hi Jody Harbour,

Thank you for the suggestion - it has been taken into consideration

Currently simultaneous usage of separator items and CheckBoxes is not supported.
However you can easily hide the checkboxes of the separator RadComboBox items by handling the OnClientDropdownOpening event in this way:
<head runat="server">
<title></title>
<script type="text/javascript">
function OnClientDropDownOpening(sender, eventArgs) {
 
    var items = sender.get_items(); for (i = 0; i < items.get_count(); i++) {
        if (items.getItem(i).get_isSeparator()) {
            var checkbox = items.getItem(i).get_checkBoxElement();
            checkbox.style.display = "none";
        }
    }
}
</script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <telerik:RadComboBox ID="RadComboBox1" runat="server" 
            OnClientDropDownOpening="OnClientDropDownOpening"
            CheckBoxes="true">
            <Items
            <telerik:RadComboBoxItem Text="A" Value="A" />
            <telerik:RadComboBoxItem Text="Separator" IsSeparator="true" />
            <telerik:RadComboBoxItem Text="B" Value="B" />
            </Items>    
        </telerik:RadComboBox>
    </div>
    </form>
</body>


Regards,
Kalina
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
Tags
ComboBox
Asked by
Jody Harbour
Top achievements
Rank 1
Answers by
Kalina
Telerik team
Share this question
or