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

Checkbox inside the Combobox

2 Answers 87 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Karthi Keyan
Top achievements
Rank 1
Karthi Keyan asked on 21 Nov 2009, 11:29 AM

Hi,
    OnClientLoad i am populating the Radcombobox with list of datas. Now  I am having a checkbox item template inside the RadCombobox, OnclientLoad how can i populate the checkbox with corresponding list of values.

<telerik:RadComboBox ID="RadComboBox1" OnClientLoad="loadComboBox" OnClientDropDownClosed="OnClientDropDownClosedHandler"  runat="server">
    <ItemTemplate>
        <div >
          <asp:CheckBox ID="CheckBox1" runat="server" Checked="true" onclick="onCheckBoxClick(this)"/>
            <asp:Label runat="server" ID="Label1" AssociatedControlID="CheckBox1">
            </asp:Label>
        </div>
  </ItemTemplate>

My function looks somewhat similar like this for binding only list of datas:
  function OnCompleteOne(result) {

                var combo = $find("<%= RadComboBox1.ClientID %>");
                for (var i = 0; i < result.length; i++) {

                    var comboItem = new Telerik.Web.UI.RadComboBoxItem();
                    comboItem.set_text(result[i]);
                    combo.trackChanges();
                    combo.get_items().add(comboItem);
                    var items = combo.get_items();
                     comboItem.select();
                    combo.commitChanges();
                }

                      }


My requriment is  i want to assign the result values to the checkbox.
Kindly provide sample code if possible.

Thanks and regards,
Karthikeyan.G

2 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 23 Nov 2009, 01:27 PM
Hi Karthi,

You cannot have a template and load the items on the client., the items should be loaded in the server in order to use the template.

Kind regards,
Yana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Karthi Keyan
Top achievements
Rank 1
answered on 25 Nov 2009, 06:32 AM
HI Yana,

        I am used RadTree for getting checkbox inside the combobox and we can get the checked nodes.
 

With regards,
Karthikeyan.G
Tags
ComboBox
Asked by
Karthi Keyan
Top achievements
Rank 1
Answers by
Yana
Telerik team
Karthi Keyan
Top achievements
Rank 1
Share this question
or