Author: WilliamSnell | Posted on: 6/18/2009 12:11:25 PM | Views : 327

One of the columns of my GridView control is a TemplateField which, as its item template, has a ListView control. The ListView control has an EditItemTemplate that I need to handle, and so I need access to its controls in the code behind. I've tried something like:
HiddenField hdn = myGridView.FindControl("myListView").FindControl("myControl") as HiddenField; However, I'm getting null as the result of finding the ListView, so the control I'm looking for is null as well. My question is actually 2 questions. First, how in the heck do I get the reference to my nested control? Even just finding the ListView isn't working.
Second, why are the controls nested inside other controls not accessible in an hierarchical manner? I should be able to find a control nested in another control by "myControl.myNestedControl". Instead, I ha ...

Go to the complete details ...