|
<ej:Grid ID="FlatGrid" runat="server" AllowSorting="True" AllowPaging="True" IsResponsive="true">
<EditSettings AllowEditing="true" AllowAdding="true" AllowDeleting="true"></EditSettings>
<ToolbarSettings ShowToolbar="true" ToolbarItems="add,edit,delete,update,cancel"></ToolbarSettings>
<ClientSideEvents DataBound="onGridDataBoundEvent" />
</ej:Grid>
</div>
<script type="text/javascript">
function onGridDataBoundEvent(args) {
this.model.columns[1].allowEditing = false;
this.refreshContent(true); //Reflect the changes in grid
}
</script>
|
|
<ej:Grid ID="FlatGrid" runat="server" AllowScrolling="True" AllowSorting="True" AllowPaging="True" IsResponsive="true">
<EditSettings AllowEditing="true" AllowAdding="true" AllowDeleting="true"></EditSettings>
<ToolbarSettings ShowToolbar="true" ToolbarItems="add,edit,delete,update,cancel"></ToolbarSettings>
<ClientSideEvents DataBound="onGridDataBoundEvent" BeginEdit="beginedit"/>
<ScrollSettings FrozenColumns="2" />
</ej:Grid>
<script type="text/javascript">
function onGridDataBoundEvent(args) {
this.model.columns[0].isPrimaryKey = true;
this.model.columns[1].allowEditing = false;
this.refreshContent(true); //Reflect the changes in grid
}
function beginedit(args){
if (args.rowIndex == 3 || args.rowIndex == 4)
args.cancel = true;
}
</script> |