Kendo Grid Column Disable

function onGridEdits(e)
{
if (e.container.find("input").attr("name") == ‘Ad’ || e.container.find("input").attr("name") == ‘Soyad’ || e.container.find("input").attr("name") == ‘TCKimlikNo’)
{
this.closeCell();
}
}

@(Html.KendoGrid<MyProject.Dto.KisiDto>(Model.kisiListesi)
.Name("kisilerGrid")
.ToolBar(c => c.Template(@<text>
<span id="gridBaslik" style="padding-left: 8px; padding-right: 0px; width: 24px; color: GrayText; font-size: 14px">Kişi Listesi</span>
</text>))
.Columns(columns =>
{
columns.Bound(c => c.Pk).Width("100px").Visible(false);
columns.Bound(c => c.Ad).Width("100px").Title("Adı");
columns.Bound(c => c.Soyad).Width("100px").Title("Soyadı");
columns.Bound(c => c.TCKimlikNo).Width("100px").Title("T.C. Kimlik No");
columns.Bound(c => c.Adres).Width("80px").Title("Adres");
})

.Selectable(c => c.Mode(GridSelectionMode.Single))
.Editable(editable => editable.Mode(GridEditMode.InCell))
.Pageable(pager =>
pager.PageSizes(new int[] { 20, 50, 100 })
)
.Events(e => e.Edit("onGridEdits"))
.Events(events => events.DataBound("onDataBound"))
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.ServerOperation(true)
.Model(model =>
{
model.Id(p => p.Pk);
}
)
)
)

Bir cevap yazın