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

Access controls inside itemtemplate

1 Answer 235 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 04 Feb 2013, 01:09 PM
Hi
     How can I access the controls inside the itemtemplate in the pre-render event of my radgrid. Please share if you have a solution.

Thanks
RT

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 04 Feb 2013, 01:13 PM
Hi,

Please try the following code snippet.

C#:
protected void RadGrid1_PreRender(object sender, EventArgs e)
{
    foreach (GridDataItem item in RadGrid2.Items)
    {
        Button btn = (Button)item.FindControl("Button1");// access the controls here
    }
}

Thanks,
Shinu.
Tags
Grid
Asked by
Ryan
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or