ClientSide set checked on my combo checkbox with id values

3 posts, 1 answers
  1. RJ
    RJ avatar
    386 posts
    Member since:
    Oct 2006

    Posted 04 Jul 2013 Link to this post

    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. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 05 Jul 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. RJ
    RJ avatar
    386 posts
    Member since:
    Oct 2006

    Posted 05 Jul 2013 Link to this post

    many thanks Shinu
Back to Top