有人可以帮助我通过webgrid跟踪视图
username location Date
a abc 12/10/2017
a def ↑ 12/10/2017
a def 12/10/2017
a def 12/11/2016
c abc 12/10/2017
username location Date
a abc 12/10/2017
a def ↓ 12/10/2017
a def 12/11/2016
c abc 12/10/2017
我在对象列表中的用户名/位置和日期字段上创建了组。但无法进行上述观察
我正在尝试关注
@{
var grid = new WebGrid(Model, canPage: false, rowsPerPage: 5, selectionFieldName: "selectedRow", ajaxUpdateContainerId: "gridContent");
<div id="gridContent">
@grid.GetHtml(tableStyle: "webGrid",
headerStyle: "header",
alternatingRowStyle: "alt",
selectedRowStyle: "select",
columns: grid.Columns(
grid.Column("Email", "User Name"),
grid.Column("location", "location"),
grid.Column("AccessedOn", "Date"),
grid.Column(format: (item) =>
{
if (item.count > 1)
{
WebGrid subGrid = new WebGrid(source: item.x);
return subGrid.GetHtml(tableStyle: "webGrid",
headerStyle: "header",
alternatingRowStyle: "alt",
selectedRowStyle: "select",
columns: grid.Columns(
grid.Column("Email", null),
grid.Column("location", null),
grid.Column("AccessedOn", null))
);
}
else
return null;
}
)
))
</div>
}
答案 0 :(得分:0)
a=>a.GroupBy(a.username).groupBy(a.location).tolist()