Find Control RadTabStrip Inside RadTab

4 posts, 1 answers
  1. mohamed
    mohamed avatar
    311 posts
    Member since:
    Mar 2011

    Posted 14 Jun 2012 Link to this post


    Find Control RadTabStrip Inside RadTab Inside RadMultiPage

    Find control Dynamic Created Check Box ,
    It's Urgent 



    Thanks Advance,
    Mohamed
  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 15 Jun 2012 Link to this post

    Hi Mohamed,

    I suppose you want to access the CheckBox that is dynamically added in the RadPageView. Here is the full code that I tried based on your scenario.

    ASPX:
    <telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1">
      <Tabs>
         <telerik:RadTab Text="RadTab1" PageViewID="RadPageView1">
         </telerik:RadTab>
      </Tabs>
    </telerik:RadTabStrip>
    <telerik:RadMultiPage ID="RadMultiPage1" runat="server">
      <telerik:RadPageView ID="RadPageView1" runat="server">
      </telerik:RadPageView>
    </telerik:RadMultiPage>
    <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" />

    C#:
    protected void Page_Load(object sender, EventArgs e)
      {
         RadTab tab1 = RadTabStrip1.FindTabByText("RadTab1");
         RadPageView PageView = tab1.PageView;
         CheckBox chk = new CheckBox();
         chk.ID = "chk";
         chk.Text = "CheckBox";
         PageView.Controls.Add(chk);
      }
    protected void Button1_Click(object sender, EventArgs e)
      {
         RadTab tab1 = RadTabStrip1.FindTabByText("RadTab1");
         RadPageView PageView = tab1.PageView;
         CheckBox chk =(CheckBox) PageView.FindControl("chk");
      }

    Please elaborate your scenario if it doesn't helps.

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. mohamed
    mohamed avatar
    311 posts
    Member since:
    Mar 2011

    Posted 15 Jun 2012 Link to this post

    Thanks For Ur Reply Princy ,

    Pls Refer The Image ,
    When I click the Add expression i Dynamic created Checkbox near that radfilter

    chk1 = (PlaceHolder)tab.FindControl("pHolder");
    chk = (CheckBox)chk1.FindControl("ChkBox" + j.ToString());

    I'm getting value from here from button click

    Thanks Advance,
    Mohamed.
  5. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 17 Jun 2012 Link to this post

    Hi Mohamed,

    The dynamically created controls have to be created on each postback, otherwise they won't be persisted. Inorder to persist the controls you should create it in the Page_Init().

    Hope this helps.

    Thanks,
    Princy.
Back to Top