私は自分の見解でこのウェブグリッドを使用しています。
<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で検索し、結果をWebグリッドに表示します。表示されるデータはダミーデータです。ビューモデルにブール値のAccountVerifiedがありますが、検証されていないアカウントへのアクションリンクを指定せず、アカウントの検証が保留中であることを示すテキストを横に表示する必要があります。誰かがこれについて私を助けることができますか?