How to find dynamically added Control in RadPanelBar

2 posts, 0 answers
  1. Lubomir
    Lubomir  avatar
    15 posts
    Member since:
    Sep 2012

    Posted 08 Aug 2012 Link to this post

    This is my source code:

    telerik:RadPanelBar runat="server" ID="RadPanelBarProperties" Width="100%" Skin="Default" ExpandMode="MultipleExpandedItems" Height="190px">
        <Items>
            <telerik:RadPanelItem Expanded="True" Text="Desciprtion" runat="server" Selected="true">
                <Items>
                    <telerik:RadPanelItem Value="Description" runat="server">
                        <ItemTemplate>
                            <div style="text-align: center;">
                                <asp:TextBox ID="txtDescription" runat="server" TextMode="MultiLine"></asp:TextBox>
                            </div>
                        </ItemTemplate>
                    </telerik:RadPanelItem>
                </Items>
            </telerik:RadPanelItem>
        </Items>
    </telerik:RadPanelBar>

    and I added from codebehind new RadPanelItem(this is part of code not all :) )
    RadPanelItem firstStep = new RadPanelItem("NewGenerated");
    RadPanelBarProperties.Items.Add(firstStep);
     
    RadPanelItem secondStep = new RadPanelItem();
    secondStep.Value = "SomeValue"
    firstStep.Items.Add(secondStep);
     
    Label lblProperty = new Label();
    lblProperty.Text = "Test";
    secondStep.Controls.Add(lblProperty);

    after this how can i  find this label(or may be TextBox) in code behind, because if is Textbox i want to catch textbox.Text value.
  2. Helen
    Admin
    Helen avatar
    1052 posts

    Posted 08 Aug 2012 Link to this post

    Hello,

    Probably you will find helpful the following help article:

    http://www.telerik.com/help/aspnet-ajax/panelbar-templates-accessing-controls.html

    Regards,
    Helen
    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top