<ej-grid id="Grid" datasource=ViewBag.parent allow-paging="true"
child-grid="@(new GridProperties() {
QueryString = "EmployeeID",
EditSettings = new EditSettings() {
AllowEditing =true, AllowAdding=true, AllowDeleting=true
},
ToolbarSettings = new ToolbarSettings() {
ShowToolbar = true,
ToolbarItems = new List<string>() {
"add", "edit", "delete", "update", "cancel"
} },
DataSource = new DataSource() {
Json = ViewBag.child1,
InsertURL = "/Home/CellEditInsert",
UpdateURL = "/Home/CellEditUpdate",
RemoveURL = "/Home/CellEditDelete",
Adaptor = "remoteSaveAdaptor"
},
Columns = { new Column() { Field = "ID", IsPrimaryKey=true, HeaderText = "OrderID" },
new Column() { Field = "EmployeeID", AllowEditing=false, HeaderText = "OrderID" },
new Column() { Field = "CustomerID", HeaderText = "CustomerID" },
new Column() { Field = "Freight", HeaderText = "Freight" },
new Column() { Field = "ShipCity", HeaderText = "ShipCity" }
},
ChildGrid = new GridProperties()
{
QueryString = "CustomerID",
DataSource = new DataSource() {
Json = ViewBag.child2,
UpdateURL = "/Home/CellEditUpdate1",
RemoveURL = "/Home/CellEditDelete1",
Adaptor = "remoteSaveAdaptor"
},
EditSettings = new EditSettings() {
AllowEditing = true, AllowAdding = true, AllowDeleting = true
},
ToolbarSettings = new ToolbarSettings() {
ShowToolbar = true,
ToolbarItems = new List<string>() { "add", "edit", "delete", "update", "cancel" }
},
Columns = {
new Column() { Field = "CustomerID", IsPrimaryKey=true, AllowEditing=false, HeaderText = "CustomerID" },
new Column() { Field = "CompanyName", HeaderText = "CompanyName" }
}
}
|