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

Accessing controls inside RadGrid

1 Answer 98 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dhaval
Top achievements
Rank 1
Dhaval asked on 06 Aug 2012, 12:01 PM
Hi All,

I have a RadGrid control and can access the controls inside it (server-side or client-side).

Now, I have a RadGrid inside that RadGrid and I want to access the controls inside that inner grid, but cannot access the controls either server-side or client-side. Especially, I want to access table or div inside the inner grid.

Please help me in this regards...Thanks in advance.

Dhaval

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 06 Aug 2012, 12:39 PM
Hi,

You can attach the ItemDataBound event for the inner grid and access the Html elements as shown below.
C#:
protected void RadGrid2_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
   if (e.Item is GridDataItem)
   {
       GridDataItem item = (GridDataItem)e.Item;
       HtmlGenericControl div = (HtmlGenericControl)item.FindControl("div1");
       HtmlTable table = (HtmlTable)item.FindControl("table1");
   }
}

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