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

Find Control RadTabStrip Inside RadTab

3 Answers 434 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
mohamed
Top achievements
Rank 1
mohamed asked on 14 Jun 2012, 12:23 PM

Find Control RadTabStrip Inside RadTab Inside RadMultiPage

Find control Dynamic Created Check Box ,
It's Urgent 



Thanks Advance,
Mohamed

3 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 15 Jun 2012, 06:53 AM
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.
0
mohamed
Top achievements
Rank 1
answered on 15 Jun 2012, 10:14 AM
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.
0
Princy
Top achievements
Rank 2
answered on 18 Jun 2012, 04:47 AM
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.
Tags
TabStrip
Asked by
mohamed
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
mohamed
Top achievements
Rank 1
Share this question
or