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

Find RadControls in asp panel

3 Answers 120 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
kd
Top achievements
Rank 1
kd asked on 10 Jan 2012, 09:58 AM
Hi all,
i have placed rad controls(RadTextBox, RadComboBox, etc) inside the asp panel, i am sending instance of asp panel to an other page and finding controls on that page can any one told me or send me a sample code that how can i find RadContols inside asp panel

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 10 Jan 2012, 11:13 AM
Hello,

Try the following code to access RadControls inside asp Panel.
CS:
protected void Page_Load(object sender, EventArgs e)
  {
    RadListView lst1 = (RadListView)Panel1.FindControl("RadListView1");
  }

Thanks,
Princy.
0
kd
Top achievements
Rank 1
answered on 10 Jan 2012, 11:28 AM
thanks for rpl but i want to find through its control type type like RadTextBox not its ID
0
Accepted
Elliott
Top achievements
Rank 2
answered on 10 Jan 2012, 07:32 PM
for (int i = 0; i < Panel1.Controls.Count - 1; i++)
{
    if (typeof Panel1.Controls[i] is RadTextBox)
    {
        RadTextBox rdtxtbox = (RadTextBox) Panel1.Controls[i];
        rdtxtbox.Text='gorkomatic';
    }
}
Tags
General Discussions
Asked by
kd
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
kd
Top achievements
Rank 1
Elliott
Top achievements
Rank 2
Share this question
or