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

Using checkbox in combobox

1 Answer 77 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Sampada
Top achievements
Rank 1
Sampada asked on 28 May 2012, 03:13 PM

Team,

I am using telerik combobox containing check box in it.

(referred URL: http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/checkboxes/defaultcs.aspx )

I have a following requirement in my application

1.Change “Check All” label to “Select All”

2.I want to check if all items are checked using “Check All” option on client side because I have notice that  OnClientItemChecked

Event Is not get triggered when all items are checked using  “Check All” option  is there alternate way for this?  

3. Whenever I select items using checkbox all checked item get displayed in combo text with comma separator but the time when focus lost from the combobox only first selected item get display in combo text. It is working proper in a demo. Can you please let me know what can be the cause of this behavior?

Thanks in advance                         

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 28 May 2012, 03:50 PM
Hi  Sampada,

1. You can localize the "Check All" to "Select All" by setting Localization-CheckAllString property of RadComboBox to "Select All".

ASPX:
<telerik:RadComboBox ID="RadComboBox1" runat="server" Localization-CheckAllString="Select All" .......>
            .....
</telerik:RadComboBox>

2. To perform a custom client-side action when the "CheckAllItems" checkbox is checked, you can easily attach a change() event handler at this checkbox in the following way.

JS:
<script type="text/javascript">
    function OnClientLoad(sender, args) {
        $telerik.$('.rcbCheckAllItemsCheckBox').change(function () {
            if (sender.get_text() == "All items checked") {
                alert(sender.get_text() + " and you can perform some custom action here");
            }
        });
    }
</script>

3. I couldn't replicate your third issue. Please try setting CheckedItemsTexts property of RadComboBox to "DisplayAllInInput" to show the RadComboBoxItems separated by comma.

Hope this helps.

Thanks,
Princy.
Tags
ComboBox
Asked by
Sampada
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or