I have a grid where I'm trying to use the endadd method to redirect to a detail page after a record is added. I'm pretty sure it worked when I first implemented it a month or two ago. However, it doesn't work anymore. My event is:
function endadd(args)
{
window.location = "/OrderItemsEdit?o=" + args.data.OrderID;
}
the related field/column is:
col.Field("OrderID").HeaderText("ID").IsPrimaryKey(true).IsIdentity(true).Visible(false).Add();
From what I can tell from reading the documentation, the IsIdentity(true) should result in an auto-incremented value. However, args.data.OrderID is zero, and results in an error in the target controller due to an invalid ID.
Should this work the way I'm understanding? If not, is there a way to achieve what I want? I was hoping that there was an event that would happen after the CRUD insert operation came back from the server, so it could get the actual ID that was auto-generated in the database, but I didn't see an event for that.