@(Html.EJ().Grid<object>("FlatGrid")
.Datasource(ds => ds.URL("api/List").BatchURL("api/Update").Adaptor(AdaptorType.UrlAdaptor))
.AllowPaging()
.EditSettings(edit => { edit.AllowAdding().AllowDeleting().AllowEditing().EditMode(EditMode.Batch).ShowConfirmDialog(); })
.ToolbarSettings(toolbar =>
{
toolbar.ShowToolbar().ToolbarItems(items =>
{
items.AddTool(ToolBarItems.Add);
items.AddTool(ToolBarItems.Edit);
items.AddTool(ToolBarItems.Delete);
items.AddTool(ToolBarItems.Update);
items.AddTool(ToolBarItems.Cancel);
});
})
.Columns(col =>
{
col.Field("UserName").HeaderText("User Name").EditType(EditingType.String).Add();
col.Field("UserEmail").HeaderText("User Email").EditType(EditingType.String).Add();
col.Field("Role").HeaderText("Role").EditType(EditingType.Dropdown).ValidationRules(v => v.AddRule("required", true).AddRule("minlength", 3)).DataSource(ViewBag.ds).Add();
}))
Thanks for reply Farveen sulthana T.
I found out that "jquery.validate.min.js" is not included in render list even though there is such file already existed in project list.
After I included that file in _Layout, it works fine and problem is solved.
FYI, I used Syncfusion project template to create project.
Best regards,
Aung