这是我的网络网格:
<div id="grid">
@grid.GetHtml(
tableStyle: "grid",
headerStyle: "head",
alternatingRowStyle: "alt",
columns: grid.Columns(
grid.Column("FullName", "Name"),
grid.Column("User.Email", "Email", format:@<a href="mailto:@item.User.Email">@item.User.Email</a>),
grid.Column("User.PhoneExtension", "Extension"),
grid.Column("ManagerName", "Manager"),
grid.Column("User.Roles", "Roles"),
grid.Column("", format: (item) => new HtmlString(Html.ActionLink("Edit", "Edit", new { userName = item.User.UserName } ).ToString() + "|" + Html.ActionLink("Details", "Details", new { userName = item.User.UserName }).ToString()))
)
)
User.Roles 是字符串的集合。如何使用“格式:”输出每个角色,然后在该单元格中换行?提前致谢。