Asp.net mvc Kendo GridView单元格值别名

Asp.net mvc Kendo GridView单元格值别名,asp.net-mvc,gridview,kendo-grid,Asp.net Mvc,Gridview,Kendo Grid,我想将IsActive列的值从True和False更改为Yes和No。代码如下: @(Html.Kendo().Grid<Silverback.Vitae.Core.Models.FormModel>() .Name("Grid") .Columns(columns => { columns.Bound(p => p.Name); columns.Bound(p => p.IsActive).Width(100).Heade

我想将IsActive列的值从True和False更改为Yes和No。代码如下:

             @(Html.Kendo().Grid<Silverback.Vitae.Core.Models.FormModel>()
.Name("Grid")
.Columns(columns =>
{
    columns.Bound(p => p.Name);
    columns.Bound(p => p.IsActive).Width(100).HeaderHtmlAttributes(new { @style = "text-align:center;" }).HtmlAttributes(new { @style = "text-align:center;" });
    columns.Bound(p => p.FormID).ClientTemplate("#= actionTemplate(data) #").Width(300).HeaderHtmlAttributes(new { @style = "text-align:center;" }).HtmlAttributes(new { @style = "text-align:center;" }).Title("Action").Sortable(false);

})
.Pageable()
.Sortable()
.Scrollable(s => s.Height("auto"))
.DataSource(dataSource => dataSource
    .Ajax()
    .Read(read => read.Action("GetForms", "Forms"))
)
@(Html.Kendo().Grid())
.名称(“网格”)
.列(列=>
{
columns.Bound(p=>p.Name);
columns.Bound(p=>p.IsActive).Width(100).HeaderHtmlAttributes(新的{@style=“text-align:center;”).HtmlAttributes(新的{@style=“text-align:center;”);
columns.Bound(p=>p.FormID).ClientTemplate(“#=actionTemplate(data)#”).Width(300).HeaderHtmlAttributes(新的{@style=“text align:center;”).HtmlAttributes(新的{@style=“text align:center;”).Title(“Action”).Sortable(false);
})
.Pageable()
.Sortable()
.可滚动(s=>s.Height(“自动”))
.DataSource(DataSource=>DataSource
.Ajax()
.Read(Read=>Read.Action(“GetForms”、“Forms”))
)

)

客户端模板将为您带来成功。常见问题解答中也解释了这一点

ClientTemplate(“#=IsActive”“Foo':”Bar“)