开发者

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)?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜