在我看来,我正在使用这个 webgrid。
<div class="grid">
@{
var grid = new WebGrid(Model.SearchResults, canPage: true, rowsPerPage: 15);
grid.Pager(WebGridPagerModes.NextPrevious);
@grid.GetHtml(
htmlAttributes: new { @style = "width:100%", cellspacing = "0" },
columns: grid.Columns(
grid.Column(header: "Customer Name", format: (item) => Html.ActionLink((string)item.FullName, "ShowContracts", new { id = item.UserId }, new { @style = "color: 'black'", @onmouseover = "this.style.color='green'", @onmouseout = "this.style.color='black'" })),
grid.Column(header: "SSN", format: item => item.SSN)
))
}
</div>
我使用 SSN 搜索并在 webgrid 中显示结果。显示的数据是虚拟数据。我的视图模型中有一个 bool AccountVerified,现在我不应该为未验证的帐户提供操作链接,并在它们旁边显示说明帐户验证待定的文本。有人可以帮我吗?