0

是否有可能RowExpander不是 HTML 而是另一行?也就是说,一行有一个展开 [+] 图标,然后展开时,子行看起来像“子行”?

例如我有一个List<ModelData>这样的:

ModelData column1 = new BaseModelData();
column1.set("Date", "11-11-11");
column1.set("Time", "11:11:11");
column1.set("Code", "abcdef");
column1.set("Status", "OK");

ModelData column2 = new BaseModelData();
column2.set("Date", "11-11-11");
column2.set("Time", "12:11:11");
column2.set("Code", "abcdef");
column2.set("Status", "Failed");

ModelData column3 = new BaseModelData();
column3.set("Date", "11-11-11");
column3.set("Time", "13:11:11");
column3.set("Code", "abcedf");
column3.set("Status", "Failed");

ModelData column4 = new BaseModelData();
column4.set("Date", "11-11-11");
column4.set("Time", "14:11:11");
column4.set("Code", "abcdef");
column4.set("Status", "Failed");

List<ModelData> data = ...
data.add(model1);
data.add(model2);
data.add(model3);
data.add(model4);

并且这将在 Grid 中呈现为两列(按CodeandStatus列分组):

         Date | Time     | Code   | Status
-------------------------------------
     11-11-11 | 11:11:11 | abcedf | OK
[+]  11-11-11 | 12:11:11 | abcedf | Failed
 |--->11-11-11 | 13:11:11 | abcedf | Failed
 |--->11-11-11 | 14:11:11 | abcedf | Failed   

像这样的东西。

更新:

我被告知解决方案是扩展RowExpander类并与类合并GridView

4

1 回答 1

0

您可以查看GroupingViewTreeGrid并为您定制其中一个。这比尝试重用 GridView 的行渲染功能要安全得多。

于 2012-10-25T19:32:22.147 回答