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

User Control Issue

3 Answers 94 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Aditya
Top achievements
Rank 1
Aditya asked on 09 May 2012, 08:07 AM
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

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 09 May 2012, 11:21 AM
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.
0
Aditya
Top achievements
Rank 1
answered on 09 May 2012, 11:42 AM
Hi,
  UserControl ctrl = (UserControl)Page.FindControl("~/UserControls/NewOnlineTemp.ascx");
The above code doesn't work. I get a null value.

Regards,
Aditya
0
Kate
Telerik team
answered on 14 May 2012, 08:29 AM
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.
Tags
General Discussions
Asked by
Aditya
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Aditya
Top achievements
Rank 1
Kate
Telerik team
Share this question
or