<EjsGrid id="Grid" ModelType="model" DataSource="gridData" OnActionBegin="@begin" Height="100%" Toolbar="@(new List<string>() { "Add", "Edit" , "Delete" , "Cancel" , "Update" })">
<GridEditSettings AllowEditing="true" AllowAdding="true" AllowDeleting="true"></GridEditSettings>
…………………………………….
</EjsGrid>
public void begin(SortEventArgs args)
{
if (args.RequestType.ToString() == "BeginEdit" || args.RequestType.ToString() == "Add") // for prevent record from editing & adding
{
args.Cancel = true; // to prevent the default action
// perform your action here
}
} |