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

Checkboxes mode only checks checkbox if checkbox clicked

5 Answers 245 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Chris Hack
Top achievements
Rank 1
Chris Hack asked on 14 Dec 2012, 05:23 PM
Telerik Version: 2012.2.724.40

The following example will not allow me to check an item by clicking anywhere on the list item.  I have to click exactly on the checkbox for it to check.  Customers are complaining about this and I'm wondering if it is a bug in Telerik.

I have taken the following snippet and put it into isolation on a simple WebForm (i.e. Test.aspx) with no master page, and the behavior is the same.

<telerik:RadComboBox ID="rcbLanguages" runat="server" CheckBoxes="True" ClientIDMode="Static" EmptyMessage="Select Languages"
    Height="200px"  Width="306px" EnableCheckAllItemsCheckBox="true"
>
    <Items>
        <telerik:RadComboBoxItem Value="en" Text="English" />
        <telerik:RadComboBoxItem Value="zh" Text="Chinese" />
        <telerik:RadComboBoxItem Value="da" Text="Danish" />
        <telerik:RadComboBoxItem Value="nl" Text="Dutch" />
        <telerik:RadComboBoxItem Value="fr" Text="French" />
        <telerik:RadComboBoxItem Value="de" Text="German" />
        <telerik:RadComboBoxItem Value="el" Text="Greek" />
        <telerik:RadComboBoxItem Value="he" Text="Hebrew" />
        <telerik:RadComboBoxItem Value="hi" Text="Hindi" />
        <telerik:RadComboBoxItem Value="it" Text="Italian" />
        <telerik:RadComboBoxItem Value="ja" Text="Japanese" />
        <telerik:RadComboBoxItem Value="la" Text="Latin" />
        <telerik:RadComboBoxItem Value="pl" Text="Polish" />
        <telerik:RadComboBoxItem Value="pt" Text="Portuguese" />
        <telerik:RadComboBoxItem Value="ru" Text="Russian" />
        <telerik:RadComboBoxItem Value="es" Text="Spanish" />
        <telerik:RadComboBoxItem Value="th" Text="Thai" />
        <telerik:RadComboBoxItem Value="vi" Text="Vietnamese" />
    </Items>
</telerik:RadComboBox>


Is there a work around for this that will not require an upgrade of the telerik version?


5 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 17 Dec 2012, 06:35 AM
Hello,

Try the following workaround to achieve your scenario.

JS:
<script type="text/javascript">
    function pageLoad() {
        $('.rcbItem').click(checkBoxItemClicked);
    }
    function checkBoxItemClicked(sender) {
        var checkBox = $(sender.target).find(':checkbox');
        checkBox.prop('checked', !checkBox.is(':checked'));
    }
</script>

Hope this helps.

Regards,
Princy.
0
Chris Hack
Top achievements
Rank 1
answered on 24 Dec 2012, 03:08 PM
This solution appeared to work until it came time to read the checked values on the server.  Apparently, setting the checkbox state to checked was not enough to actually flag the item as checked within the bowels of the RadComboBox control.  However, thanks to jquery, I did come up with a tweak that works as expected...

$('.rcbItem').click(function (sender) {
    var checkBox = $(sender.target).find(':checkbox');
    //checkBox.prop('checked', !checkBox.is(':checked'));
    checkBox.click();
});

Simulating a click event causes all the magic within the RadComboBox client side code to perform whatever it needs to do in order to make the item truly checked.

Chris
0
Kalina
Telerik team
answered on 24 Dec 2012, 03:42 PM
Hello Chris Hack,

We have already improved the CheckBoxes feature and now when the user clicks on item text - the item checkbox is gets checked(or unchecked).
Please test the RadComboBox CheckBoxes with this online demo.

Greetings,
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.
0
Chris Hack
Top achievements
Rank 1
answered on 24 Dec 2012, 03:55 PM
Thanks Kalina,

Good to hear that it's been fixed.  But just in case someone is stuck on this particular version of Telerik (as big clients tend to frown on major upgrades to production sites without a few months of intense testing in a QA environment), it's nice to have a work-around documented here.

In my case, no one noticed this issue until after it went live to production.  So I'm stuck with this work around for at least a few months.

Thanks again,

Chris
0
Tim Harker
Top achievements
Rank 2
answered on 05 Mar 2013, 05:10 PM
Chris -

Couldn't agree more with your comments.  Sometimes I think vendors overlook product development lifecycles of there bigger customers.  Not being able to cheaply enhance or fix issues is trouble-some.  It's an opportunity for other market players!!!

Tim.
Tags
ComboBox
Asked by
Chris Hack
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Chris Hack
Top achievements
Rank 1
Kalina
Telerik team
Tim Harker
Top achievements
Rank 2
Share this question
or