changing text of RadComboBox programmatically

3 posts, 0 answers
  1. Yazid
    Yazid avatar
    2 posts
    Member since:
    Dec 2012

    Posted 11 Aug 2014 Link to this post

    Hi there!
    we are using Telerik 2011. So I customized RadComboBox to provide ,,Select All"-feature. So when the ,,Select All"-item is selected a js function registered with OnClientItemChecked  will be called and iterates all other items and selects them. 

    As a result the checkboxes of the items are being selected and the content of  input area  is a comma separeted list of texts of the items.

    So my question how can I make the input area displaying only the word,,All" when the ,,Select All"-item is selected  and not a list of all items?

    Thank you in advance
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 11 Aug 2014 in reply to Yazid Link to this post

    Hi Yazid,

    In order to achieve your scenario one suggestion is try to attach the OnClientItemChecking event of RadComboBox and try the below JavaScript.

    function selectAll(sender, args) {
        var index, count;
        count = sender.get_items().get_count();
        if (args._item._text == "Select All") {
            for (index = 1; index < count; index++) {

    Another suggestion is that you can upgrade the Telerik version and  change the "Check All" string value using the RadComboBox Localization. Please take a look into this online demo.


  3. Yazid
    Yazid avatar
    2 posts
    Member since:
    Dec 2012

    Posted 13 Aug 2014 in reply to Princy Link to this post

    Hi Princy,
    thank you for the answer. 
    Unfortunatly, OnClientItemChecking  will not work because the Text will be set later after all CheckBoxes have been selected.
    Telerik upgrade can't be performed at moment because it will affect the whole application framework. The appliication and application 
    framework are comprised of many hundred of thousand code lines at least.

    But I found out  by using a reflectorthat the iput field is rendered in a method named,,RenderTable" wich is rendered
    in the RenderContents-method.

    So I can override the RenderContents-method to achieve the desired result.

    Anaway thank you very much.

Back to Top