Editor: Row Reorder Precreate Issue

Editor: Row Reorder Precreate Issue

kmboninkmbonin 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();
                };

Replies

  • allanallan Posts: 63,201Questions: 1Answers: 10,415 Site admin

    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

  • kmboninkmbonin Posts: 59Questions: 16Answers: 0

    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.

This discussion has been closed.