Access User Control DataGrid Controls from parent page
here my code-
GridView gvCondition = (GridView)this.FindControl("ucCondition").FindControl("g开发者_高级运维vCondition");
gvCondition.DataSource = objConditionFieldCollection;
gvCondition.DataBind();
but it is throwing as exception Object reference not set to an instance of an object.
How can I access user control's gridview control from parent page?
I don't know where you trying to access the UserControl's GridView, but why don't you simply expose a public property in the UserControl that returns the GridView(f.e. ConditionView
)?
精彩评论