This is a migrated thread and some comments may be shown as answers.

Add/Edit Clear State

1 Answer 63 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 10 Sep 2012, 05:39 PM
Hi have implemented a Grid using Open Access as the ORM.

The data displays fine as does completing updates. However if you add an item and save it, then every subsequent edit on existing items creates a new entry as each edit is behaving as a newly added Item.

The only way to stop this is to manually refresh the page.

Rob

1 Answer, 1 is accepted

Sort by
0
Robert
Top achievements
Rank 1
answered on 12 Sep 2012, 01:23 PM
Problem solved 

When creating an new item you should return a collection with the updated record with the ID set 
from the action so that the DataSource can know that the item is successfully created and it can be distinguished from the new items e.g.


return Json(new [] { pmgToCreate }.ToDataSourceResult(request, ModelState));
Tags
Grid
Asked by
Robert
Top achievements
Rank 1
Answers by
Robert
Top achievements
Rank 1
Share this question
or