User Control Issue

4 posts, 0 answers
  1. Aditya
    Aditya avatar
    20 posts
    Member since:
    May 2011

    Posted 09 May 2012 Link to this post

    Hi,
    I have a RadTree in User Control A & RadioButtonList in another User Control B under my main aspx page. When I check a node in RadTree in User Control A., I want to get selected index of RadioButtonList 
    in User Control B. How i'm i supposed to get the output.??

    Regards,
    Aditya
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 09 May 2012 Link to this post

    Hello Aditya,

    Try the following code to achieve your scenario.
    C#:
    protected void Radtreeview1_NodeClick(object sender, Telerik.Web.UI.RadTreeNodeEventArgs e)
    {
      UserControl ctrl = (UserControl)Page.FindControl("WebUserControlB");
      RadioButtonList list = (RadioButtonList)ctrl.FindControl("RadioButtonList1");
      string value=list.SelectedIndex.ToString();
    }

    Thanks,
    Princy.
  3. Aditya
    Aditya avatar
    20 posts
    Member since:
    May 2011

    Posted 09 May 2012 Link to this post

    Hi,
      UserControl ctrl = (UserControl)Page.FindControl("~/UserControls/NewOnlineTemp.ascx");
    The above code doesn't work. I get a null value.

    Regards,
    Aditya
  4. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 14 May 2012 Link to this post

    Hello Aditya,

    One way I can think of is that you use either client-side or server side of the RadTreeView events (Server-Side Events or Client-Side Events) and find the user control and then the corresponding control (here is more information how to achieve this on the server). In case this does not help I would recommend that you open a support ticket and send me a simple runnable page that I can inspect locally and help you out in the particular scenario. 

    Kind regards,
    Kate
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top