I'm inserting a row into my grid, with a default ID of zero, and when I save it I'm setting the ID on the server.
I now want to refresh the grid so it includes the new ID value, rather than the default, so that I can re-edit the row (if it stays with a zero ID it tries adding it as a new row again).
I can achieve this by adding grid.dataSource.read(); to the requestEnd event, but this refreshes the whole grid, moving the new row to its correct position depending on sort order (which might be on a different page). I want the display to remain the same, with the new row at the top.
I've found a lot of similar posts, and the solution usually offered is that if the new row is returned from the Post method is the same format as the Get method returns, then everything should refresh automagically.
I can't get this working though. Perhaps the two methods don't return compatible results?
My Get method returns IHttpActionResult
but my Post method returns Task<IHttpActionResult>
Any ideas? I can post more source code if needed but don't want to confuse matters by posting lots of irrelevant stuff!