Bazenga Posted September 25, 2009 Share Posted September 25, 2009 So I have this messed up code: <asp:UpdatePanel id="uPanel"> <contenttemplate> <asp:GridView id="OutterGrid"> <Columns> <asp:TemplateField> <ItemTemplate> <asp:Panel id="panel"> <asp:GridView id="myGrid"> </asp:GridView> </asp:Panel> *snip* I need a reference for the most inner gridview (myGrid). I need access to it from the code behind. I tried (and still trying) to get it but everything I do is throwing "Object reference is not set to an instance of an object". Any help is appreciated, thanks. Link to comment Share on other sites More sharing options...
0 Bazenga Posted September 25, 2009 Author Share Posted September 25, 2009 Okay, I got it now. I had to do this: foreach(GridViewRow row in OutterGrid.Rows) { GridView view = row.FindControl("myGrid") as GridView; } Link to comment Share on other sites More sharing options...
Question
Bazenga
So I have this messed up code:
I need a reference for the most inner gridview (myGrid). I need access to it from the code behind. I tried (and still trying) to get it but everything I do is throwing "Object reference is not set to an instance of an object".
Any help is appreciated, thanks.
Link to comment
Share on other sites
1 answer to this question
Recommended Posts