Editor: Row Reorder Precreate Issue
Editor: Row Reorder Precreate Issue
kmbonin
Posts: 59Questions: 16Answers: 0
Having an issue with the editor precreate function in my codebehind. The error I get on the Create form only is: The given key was not present in the dictionary.
Not sure what I'm doing wrong, as there are not a lot of examples in .net on row reordering in Editor.
Appreciate the assistance.
PreCreate Code in the controller:
response.PreCreate += (sender, e) => {
response.Db()
.Query("update", "logan_alerts")
.Set("displayOrder", "displayOrder + 1", false)
.Where("displayOrder", e.Values["displayOrder"], ">=")
.Exec();
};
This discussion has been closed.
Replies
Which line it is specifically that is failing?
e.Values["displayOrder"]
this one?If you use the debugger, what does
e.Values
actually contain? What is the data that is being submitting from the client-side?Thanks,
Allan
Found a work around. Changed e.Values["displayOrder"] to just "displayOrder" (no e.values or brackets) and then disabled strict mode on my mySQL db.