重复多个网格视图?

时间:2014-10-13 05:21:11

标签: asp.net gridview aspxgridview

我想重复多个网格视图。


问题:我在页面上有一个客户列表,如果用户选择任何客户,我必须为包含不同数据的主题显示彼此之下的2个网格。现在,对于每个客户,我必须显示详细信息网格,并且该网格下方必须显示摘要网格。这工作正常但现在一个新的要求是,如果没有选择客户,那么我必须显示所有客户的详细信息和摘要网格一个接一个地重复。 我根据需要使用网格和项目模板管理显示数据,我做的是


1) Bind Master grid first and on the RowDataBound event get its customer id for that row 
2) On Row RowCreated check if customer is same for current row and previous row if not insert the new row with gridview 
3) And On PreRender Bind that inserted gridview row with the summary data. 

它工作正常。

但是,我觉得这不是正确的方法,有没有其他方法来实现这一目标。 任何帮助都会很棒。如有任何疑惑,请随时发表评论。如果代码需要我如何做,那么请留下评论。我会在这里发布我的代码。

1 个答案:

答案 0 :(得分:0)

如果您使用ASPxGridView的{​​{3}},情况会更好。它正是为此目的而创建的。您还可以添加摘要和其他设置以实现所需的视图。