John

John

  • NA
  • 928
  • 131k

CRUD in MVC kendogrid using custom commands

Jun 19 2017 1:50 AM
@(Html.Kendo().Grid()
.Name("Grid")
.Columns(columns =>
{
columns.Bound(e => e.U_ID).Visible(false);
columns.Bound(e => e.FirstName).Title("First Name");
columns.Bound(e => e.LastName).Title("Last Name");
columns.Bound(e => e.Username).Title("User Name");
columns.Bound(e => e.Password).Title("Password").ClientTemplate("#: Array(data.Password.length).join('*') #").EditorTemplateName("password");
columns.Bound(e => e.Group_Name).Title("Group").EditorTemplateName("_AdminUserGroup").ClientTemplate("#: Group_Name #");
columns.Bound(e => e.Active).Title("Active").ClientTemplate("
");
columns.Command(command => command.Custom("Edit").Click("onEdit"));
columns.Command(command => command.Custom("Delete").Click("onDelete"));
})
.ToolBar(toolBar => toolBar.Template("Add new record"))
.Selectable(selectable => selectable.Enabled(true).Mode(GridSelectionMode.Single).Type(GridSelectionType.Row))
.Editable(editable => editable.Mode(GridEditMode.InLine))
.Events(m =>
{
m.Change("onChangeUserGrid");
m.Edit("onEdit");
m.Remove("onDelete");
})
.DataSource(dataSource => dataSource
.Ajax()
.Model(model =>
{
model.Id(p => p.U_ID);
model.Field(p => p.Active).Editable(false);
})
.Read(read => read.Action("GetCompanyUsers", "Inspire").Data("CheckUserID")
))
)
 
 
Command using jqeury not working

Answers (3)