In the next action result _transaction.row is always null, this piece of code is very similar to the one found in http://help.infragistics.com/Help/Doc/jQuery/2013.1/CLR4.0/html/igGrid_Updating.html#column_settings_editors
public ActionResult UpdatingSaveChanges() { ViewData["GenerateCompactJSONResponse"] = false; var _gridModel = new GridModel(); var _transactions = _gridModel.LoadTransactions<MyRowItem>(HttpContext.Request.Form["ig_transactions"]);
foreach (var _transaction in _transactions) { // _transaction catch all the transactions correctly but, // _transaction.row IS ALWAYS NULL, WHY?
if (_transaction.row.IsOk != null) { // Do something here. } }
var _result = new JsonResult(); var _response = new Dictionary<string, bool> {{"Success", true}}; _result.Data = _response; return _result; }
See the attached source code (TestSolution.rar), I have it in a Visual Studio 2013 solution for a MVC 4 demo with Infragistics 2014.1.
I can see all the transactions made in the client side but _transaction.row is always null, what's wrong here?
Hello Luis,
Thank you for contacting us and for the provided sample!
About your question, this is happening because you need to set GridEditMode to be Row, and not Cell. Please make this change and observe how now "row" wont be empty.
Code snippet:
.Features(pFeatures => pFeatures.Updating().EnableAddRow(false)
.EnableDeleteRow(false).EditMode(GridEditMode.Row))
Screenshot:
:( Changing to GridEditMode.Row makes the transaction log to catch only one row, how to log all the edited rows?
Fantastic, that worked! :) Now, two more questions:
1) how do I hide the Done/Cancel dialog?
2) how to submit the last change in the grid when the user press submit button. I have noticed that if for example you edit one row, then go to another row (at this moment the first edited row becomes italic) and edit a cell then press Submit button, the last change is not part of the transacctions.
Thank you so much guy, you saved my life!