CheckBoxes enhancment req

2 posts, 0 answers
  1. Jody Harbour
    Jody Harbour avatar
    17 posts
    Member since:
    Feb 2009

    Posted 30 Sep 2011 Link to this post

    when using checkboxs if you have a item set to isseperator then remove the checkbox from that option.
  2. Kalina
    Admin
    Kalina avatar
    918 posts

    Posted 05 Oct 2011 Link to this post

    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
Back to Top