This question is locked. New answers and comments are not allowed.
I have this grid:
It is client bound.
I also have
When I edit the row, the values are updated, but if the grid turns to display only mode again, then the new checked values are not displayed.
I have checked in the debugger, if the value is set and if it is correctly retrieved from the database.
So yes, the value is set and it is correctly retrieved from the db. It is there in vd before I return it.
So it is a display problem
| c.Bound(r => r.Urgent).ReadOnly(false) |
| .ClientTemplate("<input type='checkbox' disabled='disabled' name='Urgent' <#= Urgent? checked='checked' : '' #> />"); |
| c.Bound(r => r.Important).ReadOnly(false) |
| .ClientTemplate("<input type='checkbox' disabled='disabled' name='Important' <#= Important? checked='checked' : '' #> />"); |
I also have
| c.Command(s => |
| { |
| s.Select(); |
| s.Edit(); |
| s.Delete(); |
| }) |
I have checked in the debugger, if the value is set and if it is correctly retrieved from the database.
| [Authorize] |
| [GridAction] |
| public ActionResult AjaxGridUpdate(string id) |
| { |
| var trans = new PlatformTransaction(); |
| var bon = new BusinessObjectNode<Workitem>(trans); |
| bon.Retrieve(id); |
| var workitem = bon.Entity(id); |
| workitem.Title = Request.Form["Title"]; |
| workitem.RemainingDays = double.Parse(Request.Form["RemainingDays"]); |
| workitem.RemainingHours = double.Parse(Request.Form["RemainingHours"]); |
| workitem.Status = Request.Form["Status"]; |
| workitem.Urgent = bool.Parse(Request.Form["Urgent"]); |
| workitem.Important = bool.Parse(Request.Form["Important"]); |
| //if (TryUpdateModel<Workitem>(workitem, new string[] { "Title" })) |
| //{ |
| workitem.ChangedAt = DateTime.UtcNow; |
| workitem.ChangedBy = System.Web.HttpContext.Current.User.Identity.Name; |
| bon.Update(workitem); |
| trans.Save(); |
| //} |
| var fatherId = workitem.SuperWorkitem; |
| var vd = SelectGridModel(fatherId); |
| return View(new GridModel(vd.gridRows)); |
| } |
So it is a display problem