Get radio button event inside the rad tree list edit template

4 posts, 0 answers
  1. Prassin
    Prassin avatar
    87 posts
    Member since:
    Jun 2012

    Posted 29 Jun 2012 Link to this post

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

    Posted 29 Jun 2012 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Prassin
    Prassin avatar
    87 posts
    Member since:
    Jun 2012

    Posted 29 Jun 2012 Link to this post

    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

  5. Prassin
    Prassin avatar
    87 posts
    Member since:
    Jun 2012
Back to Top