Accessing RadComboBox in nested ASCX's

3 posts, 0 answers
  1. Dave
    Dave avatar
    2 posts
    Member since:
    Jul 2014

    Posted 31 Jul 2014 Link to this post

    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. Dave
    Dave avatar
    2 posts
    Member since:
    Jul 2014

    Posted 31 Jul 2014 in reply to Dave Link to this post

    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"

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 31 Jul 2014 in reply to Dave Link to this post

    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.
Back to Top