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

Get radio button event inside the rad tree list edit template

3 Answers 72 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
Prassin
Top achievements
Rank 1
Prassin asked on 29 Jun 2012, 07:19 AM
Hi All,,


i have a rad tree list and its having 2 radio button under edit item template... i need that radio button event.. which event i can use for getting that event... please help.


Regards,

Prassin

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 29 Jun 2012, 07:57 AM
Hello Prassin,

Here is the sample code that I tried based on your scenario.
aspx:
<telerik:TreeListTemplateColumn UniqueName="ColumnUniqueName">
  <EditItemTemplate>
      <asp:RadioButton ID="RadioButton1" runat="server" />
      <asp:RadioButton ID="RadioButton2" runat="server" />
   </EditItemTemplate>
</telerik:TreeListTemplateColumn>
C#:
protected void RadTreeList1_ItemCreated(object sender, Telerik.Web.UI.TreeListItemCreatedEventArgs e)
{
 if (e.Item is TreeListEditFormItem && ((TreeListEditFormItem)e.Item).IsInEditMode)
 {
   TreeListEditableItem item = e.Item as TreeListEditableItem;
   RadioButton rad1 = (RadioButton)item.FindControl("RadioButton1");
   RadioButton rad2 = (RadioButton)item.FindControl("RadioButton2");
   rad1.AutoPostBack = true;
   rad2.AutoPostBack = true;
   rad2.CheckedChanged += new EventHandler(rad2_CheckedChanged);
   rad1.CheckedChanged += new EventHandler(rad1_CheckedChanged);
 }
}
void rad1_CheckedChanged(object sender, EventArgs e)
{
}
void rad2_CheckedChanged(object sender, EventArgs e)
{
}

Thanks,
Shinu.
0
Prassin
Top achievements
Rank 1
answered on 29 Jun 2012, 08:48 AM
Hi Shinu..

 am using VB.Net

when i try to convert this code that time an error showing like ""Error 24 'Public Event CheckedChanged(sender As Object, e As System.EventArgs)' is an event, and cannot be called directly. Use a 'RaiseEvent' statement to raise an event. ""

Regards,

Prassin

0
Prassin
Top achievements
Rank 1
answered on 29 Jun 2012, 10:09 AM
Tags
TreeList
Asked by
Prassin
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Prassin
Top achievements
Rank 1
Share this question
or