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

how to write this in C#?

1 Answer 57 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Bhuvan
Top achievements
Rank 1
Bhuvan asked on 09 Mar 2011, 10:11 AM
how to write this staement in  $get(combo.get_id() + "_i" + i + "_chk_CheckLabel");  in C#

1 Answer, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 09 Mar 2011, 12:47 PM
Hello Bhuvan,

I am not quite sure about your scenario and I suppose that you want to access the CheckBox control which is in side the ItemTemplate.
Here is a sample which demonstrates the same.
aspx:
<telerik:RadComboBox ID="RadComboBox1" >
  <ItemTemplate>
        <asp:CheckBox runat="server" ID="CheckBox1"  />
        <%# DataBinder.Eval(Container, "Text") %>
   </ItemTemplate>
   <Items>
        <telerik:RadComboBoxItem Value="10/10/2010" Text="10/10/2010" />
        <telerik:RadComboBoxItem Value="10/3/2010" Text="10/3/2010" />
        <telerik:RadComboBoxItem Value="10/10/2010" Text="10/10/2010" />
        <telerik:RadComboBoxItem Text="Date1" IsSeparator="true" />
  </Items>
</telerik:RadComboBox>

C#:
protected void Button1_Click(object sender, EventArgs e)//accessing the checkboxes in a Button click
  {
      foreach (RadComboBoxItem item in RadComboBox1.Items)
      {
        CheckBox chk= (CheckBox)item.FindControl("CheckBox1");
      }
  }

Thanks,
Shinu.
Tags
ComboBox
Asked by
Bhuvan
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or