Set Checked Items On Client Side

3 posts, 0 answers
  1. barlas
    barlas avatar
    2 posts
    Member since:
    Mar 2014

    Posted 07 Mar 2014 Link to this post


    I use a combobox with checkboxes. I can get the checked values on the client side just I couldn't figure out how to set the checkboxes checked on client side. I know how to do it on serverside but we have a no-postback ajax enviroment and need to do this in client side.

    ddNewLocation combobox is databinded on page_load on server_side like below.

    ddNewLocation.DataSource = dr;

    With the below code I could set the selectedindices but it doesn't check the checkboxes visually. How can I achieve this?

    var location = $find("<%= ddNewLocation.ClientID %>");
    var locations = JSON.parse(result.Message);
    for (var i = 0; i < locations.length; i++)

    Thanks. My Company has a paid account but I didnt have time to find the username and password.
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 07 Mar 2014 in reply to barlas Link to this post

    Hi barlas,

    Please have a look into the sample code snippet which works fine at my end. Let me know if you have any concern.

    <telerik:RadComboBox ID="RadComboBox1" runat="server" CheckBoxes="true">
    <telerik:RadButton ID="RadButton1" runat="server" Text="CheckItem" OnClientClicked="OnClientClicked" AutoPostBack="false">

    protected void Page_Load(object sender, EventArgs e)
        RadComboBox1.DataSourceID = "SqlDataSource1";
        RadComboBox1.DataTextField = "Name";
        RadComboBox1.DataValueField = "ID";

    <script type="text/javascript">
        function OnClientClicked(sender, args) {
            var combo = $find("<%=RadComboBox1.ClientID %>");

  3. barlas
    barlas avatar
    2 posts
    Member since:
    Mar 2014

    Posted 07 Mar 2014 in reply to Shinu Link to this post

    Thanks Shinu,

    This is exactly what I was looking for. I was out of my way trying to find a solution as seen in the code I posted.

    Thanks again.
Back to Top