Hello,
I'm using an igGrid via MVC wrapper and I also have editors for my Model on the same page. When I call saveChanges for the Grid the Controller method tied to the UpdateURL property does not seem to see any of my Model data (the model is null). Conversely, if I submit my changes via HttpPost, the Controller sees my Model but when calling this code:
List<Transaction<FAMSPlaybookActivity>> transactions = gridModel.LoadTransactions<FAMSPlaybookActivity>(HttpContext.Request.Form["ig_transactions"]);
I would get the error:
'System.ArgumentNullException' - String reference not set to an instance of a String.
I believe this is because the ig_transaction is null. How would I expose the grid transaction to my Controller post method? I need to save both my Model data and Grid transaction on the same controller method. An example code would be appreciated, thanks!
Does the sample and the information I provided meet your requirements? Please let me know if I may be of any further help.
Hello, the way you would want to go about this is to pull the transactions out of the grid and add them to a hidden field on your form. Assuming that the rest of your model data is also in fields on the form then when you press a submit button you'll automatically send all of the data you want to the controller at once. I've attached a small sample that demonstrates how to get the data from the client to the server. Since I'm just using mock data no changes are stored/persisted, but this should give you a good idea on how to be able to send the data and access it.
For storing the grid data in a hidden field on the page I used the approach that Zdravko provides in this forum thread: http://es.infragistics.com/community/forums/t/85972.aspx
Please let me know if you have any questions or concerns about this implementation or let me know if I may be of any other help.
This is getting frustrating..you are basically pasting the same code that I put myself in my original post. Can you please READ my question and understand it. When I call OrdersSaveData I do not see my model data! I need to see both my Model data and the transaction object.
Is there another level of support that can address this since you don't seem to understand my problem.
Please have a look just below the rest-editing
public ActionResult OrdersSaveData() {
List<Transaction<Order>> transactions = gridModel.LoadTransactions<Order>(HttpContext.Request.Form["ig_transactions"]);
.....
Please review it and let me know if this approach would work for you. The transaction object is accessed in the controller in the example above. Please let me know If I misunderstood you correctly.
No, that's not what I'm looking for. I need to access the grid's transaction object in my controller on the post. How is this going to help me?
[ActionName("rest-editing")] public ActionResult RestEditing() { return View("rest-editing"); }
That does not show me anything. Please look over my original question and fully understand it before answering. I need to be able to access this from the controller on the post:
That code is directly from the Basic Edit example. As I said, running that code on my controller save method returns a null object. I can see it using the grid's saveChanges controller method but that method does not see my model. I need to see both my model data and the transaction object.