asp.net - Access User Control DataGrid Controls from parent page -


here code-

gridview gvcondition = (gridview)this.findcontrol("uccondition").findcontrol("gvcondition"); gvcondition.datasource = objconditionfieldcollection; gvcondition.databind(); 

but throwing exception object reference not set instance of object.how can access user control's gridview control parent page?

i don't know trying access usercontrol's gridview, why don't expose public property in usercontrol returns gridview(f.e. conditionview)?


Comments

Popular posts from this blog

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

apache - Add omitted ? to URLs -

php - How can I stop spam on my custom forum/blog? -