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

Accessing RadComboBox in nested ASCX's

2 Answers 31 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Dave
Top achievements
Rank 1
Dave asked on 31 Jul 2014, 04:50 PM
i have a series of "nested" child controls in a .net site.  i need to be able to use the client side api against telerik controls that are layered down in the nested controls from both the aspx page, and "parent' level controls - hope that makes sense.

I have done the same api work down one level, but not successful to date with multiple layers of nesting. 

thanks

2 Answers, 1 is accepted

Sort by
0
Dave
Top achievements
Rank 1
answered on 31 Jul 2014, 07:32 PM
I should add

$find("<%= SomeControl.ClientID %>")  - is the code i've used for "one layer" - my issue is when "SomeControl" is actually nested a few layers down

aspx -> control1 -> control2 -> SomeControl (here is where the RadComboBox resides) 

i need to access it from "control1"

0
Shinu
Top achievements
Rank 1
answered on 01 Aug 2014, 03:52 AM
Hi Dave,

Please have a look into the sample code snippet which works fine at my end.

ASPX:
<uc1:UC1 ID="UC11" runat="server" />

UserControl 1:
<uc1:UC2 ID="UC21" runat="server" />

UserControl 2:
<telerik:RadComboBox ID="RadComboBox1" runat="server">
</telerik:RadComboBox>

UserControl 1 JavaScript:
function pageLoad() {
    var comboBox = document.getElementById('<% =this.UC21.RadComboBox1ClientID%>');
    //your code
}

UserControl 2 C#:
public string RadComboBox1ClientID { get { return this.RadComboBox1.ClientID; } }

Hope this will helps you.
Thanks,
Shinu.
Tags
Ajax
Asked by
Dave
Top achievements
Rank 1
Answers by
Dave
Top achievements
Rank 1
Shinu
Top achievements
Rank 1
Share this question
or