find control within itemtemplate client side

5 posts, 0 answers
  1. Frank
    Frank avatar
    18 posts
    Member since:
    Oct 2011

    Posted 06 Jan 2014 Link to this post

    Is there a method for the client side so that I can access the control within the itemtemplate in lightbox item?  I have asp label (or I can use radtextbox) inside of the lightbox itemtemplate and need to change value.

    Thank you!

  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 06 Jan 2014 Link to this post

    Hi Frank,

    Please have a look into the following code snippet to access the ItemTemplate control of RadLightBox from client side.

    <telerik:RadLightBox ID="CodeLightBox" runat="server" Width="1000px" Modal="true"
            <AnimationSettings HideAnimation="Resize" NextAnimation="Fade" PrevAnimation="Fade"
                ShowAnimation="Resize" />
                    <telerik:RadTextBox ID="RadTextBox1" runat="server" CssClass="demo">

    <script type="text/javascript">
        function OpenCodeLightBox() {
            var lightBox = $find('<%=CodeLightBox.ClientID %>');
            var Text = lightBox.get_element().getElementsByClassName("demo");
            Text.CodeLightBox$RadTextBox1.control.set_value("new value");

  3. Frank
    Frank avatar
    18 posts
    Member since:
    Oct 2011

    Posted 07 Jan 2014 Link to this post

    Thank you Princy!  I did not see the get_element() in the online documentation.  
  4. Eduardo
    Eduardo avatar
    2 posts
    Member since:
    Dec 2011

    Posted 23 Apr 2015 Link to this post

    How do I access a template radlightbox in C # instead of the script below: 

    <script type="text/javascript">    function OpenCodeLightBox() {        var lightBox = $find('<%=CodeLightBox.ClientID %>');;        var Text = lightBox.get_element().getElementsByClassName("demo");        Text.CodeLightBox$RadTextBox1.control.set_value("new value");    }</script>



  5. Angel Petrov
    Angel Petrov avatar
    1137 posts

    Posted 28 Apr 2015 Link to this post


    If you want to access the RadLigthtBox you can do this directly by using its ID. However if you want to access the RadTextBox inside the ItemTemplate of the first item you can do something like this.

    RadTextBox textBox1=CodeLightBox.FindControl("RadTextBox1") as RadTextBox;

    Angel Petrov

    See What's Next in App Development. Register for TelerikNEXT.

Back to Top