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

ClientSide set checked on my combo checkbox with id values

2 Answers 193 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
RJ
Top achievements
Rank 1
RJ asked on 04 Jul 2013, 02:15 PM
Hi All,

How can I set checkbox checked on my radcombo by passing id values using client side. I was able to make this work on serverside using itemdatabound but then I would like to make it work on client side. I am passing id values e.g. "1,5,10,13"  which will make checkbox on my combo with value of 1,5,10 and 13 be checked.

Thanks in advance,
Rj

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 05 Jul 2013, 05:09 AM
Hi RJ,

Please have a look at the following JavaScript code I tried which works fine as expected. In your case you can pass the value of items as an array to the following function.

JavaScript:
<script type="text/javascript">
    function checkItems() {
        var idvalues = new Array(1, 3, 5, 7);  //Array containing RadCombobox values
        var radcombobox = $find('<%=RadComboBox1.ClientID %>');
        for (var i = 0; i < idvalues.length; i++) {
            radcombobox.findItemByValue(idvalues[i]).set_checked(true);
        }
    }
</script>

Thanks,
Shinu.
0
RJ
Top achievements
Rank 1
answered on 05 Jul 2013, 09:36 AM
many thanks Shinu
Tags
ComboBox
Asked by
RJ
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
RJ
Top achievements
Rank 1
Share this question
or