Devexpress aspxgridview - 主 - 详细 - 运行时绑定,找不到详细网格
因此,我在页面上创建了两个 gridview,在后面的代码中定义了它们的数据源:
protected void Page_Load(object sender, EventArgs e)
{
DataTable dt = Common_Users.GetUsersDataTable();
gvMaster.DataSource = dt;
gvMaster.DataBind();
gvDetail.DataSource = dt;
gvDetail.DataBind();
}
然后告诉 Master gv 使用详细信息行,然后打开detailsRow 模板,然后(如 devexpress 所说)将 DETAIL gv 放入该模板中。
但是,现在我的 page_load 无法再精细 gvDetail ...我如何继续调用 gvDetail 现在它在 gvMaster 内部?
So I create plop two gridviews onto page, define BOTH their datasources in code behind :
protected void Page_Load(object sender, EventArgs e)
{
DataTable dt = Common_Users.GetUsersDataTable();
gvMaster.DataSource = dt;
gvMaster.DataBind();
gvDetail.DataSource = dt;
gvDetail.DataBind();
}
Then tell the Master gv to use a details row and I open the detailsRow template and (as devexpress says to do) I put the DETAIL gv inside that template.
However, NOW my page_load can no longer fine gvDetail ... How do I continue to call gvDetail NOW that its inside of gvMaster?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有必要通过处理其 BeforePerformDataSelect 事件来为详细 ASPxGridView 提供数据。检查 http://www.devexpress.com/Support/Center/e/E257 .aspx 示例来查看此方法的实际效果。
It is necessary to provide data for detail ASPxGridView by handling its BeforePerformDataSelect event. Check the http://www.devexpress.com/Support/Center/e/E257.aspx example to see this approach in action.