Bahar Jalali

Bahar Jalali

  • NA
  • 153
  • 259k

Grdiview inside Gridview in C#

Dec 9 2009 3:30 AM
hi

i have a gridview called Gridview1 that include an either Gridview inside . child gridview called Grid1

now i want access to child gridivew in c#

i write this code:
 GridView MyGrid = (GridView)GridView1.TemplateControl.FindControl("Grid1");

but i confronted this error:
 Object reference not set to an instance of an object.

in this code i get that error too:
 GridView MyGrid = (GridView)GridView1.FindControl("Grid1");

how can i do that?

Answers (1)