combobox value deleted with backspace but items are still selected

2 posts, 0 answers
  1. Karel
    Karel avatar
    8 posts
    Member since:
    Aug 2011

    Posted 21 Jan 2014 Link to this post

    Hi,

    I have RadCombobox with checkboxes. User checks some values then click outside the combobox, then she deletes the combobox value with backspace and click outside again. Now combobox shows empty message but originaly checked items are still checked.

    Do I have to uncheck them on client side?

    Thank you.
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 21 Jan 2014 Link to this post

    Hi Karel,

    Please have a look into the following code snippet to achieve your scenario.

    ASPX:
    <telerik:RadComboBox ID="RadComboBox1" runat="server" CheckBoxes="true" EmptyMessage="select"
        AllowCustomText="true" onkeydown="uncheck(event);">
        <Items>
            <telerik:RadComboBoxItem Text="Item1" />
            <telerik:RadComboBoxItem Text="Item2" />
            <telerik:RadComboBoxItem Text="Item3" />
        </Items>
    </telerik:RadComboBox>

    JavaScript:
    <script type="text/javascript">
        function uncheck(event) {
            if (event.keyCode == 8) {
                var combo = $find("<%=RadComboBox1.ClientID %>");
                var item = combo.get_text();
                combo.findItemByText(item).uncheck();
            }
        }
    </script>

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top