<ejs-grid id="Grid" dataSource="ViewBag.dataSource" actionBegin="actionBegin" toolbar="@(new List<string>(){"Add","Update","Delete","Cancel"})" allowPaging="true" height="300">
<e-grid-editSettings allowAdding="true" allowDeleting="true" allowEditing="true"></e-grid-editSettings>
<e-grid-columns>
<e-grid-column field="OrderID" width="110" isPrimaryKey=true></e-grid-column>
<e-grid-column field="CustomerID" headerText="CustomerID" width="110"></e-grid-column>
<e-grid-column field="Freight" headerText="Freight" format="#,##0.00€" textAlign="Right" width="120"></e-grid-column>
<e-grid-column field="Verified" headerText="Verified" width="110"></e-grid-column>
</e-grid-columns>
</ejs-grid>
<script>
function actionBegin(args) {
if (args.requestType === 'beginEdit' && args.rowData.Verified==false) {
args.cancel = true;
}
}
</script> |