I'm trying to use the IgniteUI Grid control with MVC. The data appears in the Grid properly when viewing, but when I call my Edit ActionResult method in my controller to save the view back to the model, the property that is bound to the Grid comes back as being null while all other fields have their correct values. The Grid only renders a single property of the model, not the entire thing. I cannot figure out what I need to do in order to get the Grid to push its data into the view and back to the model when saving.
I have attached a stripped down example of what I am trying to do. The real code has a lot more properties, all of which get their correct values except for the Grid.
Any suggestions as to how I can the Grid data to be sent back with everything else? Do I need to call something in order for the Grid to save its data so that it's sent back with the rest of the view data?
Thanks.
Hello Keith,
Thank you for your feedback.
I am glad that you find my suggestion helpful.
Please let me know if you need any further assistance with this matter.
Thanks for the info, Vasya! It helped point me in the right direction and I've managed to get everything serialized and can push it back into model using the controller's ActionResult.
The igGrid is not directly associated with the MVC Model and will not automatically update the associated collection.
If you wish to apply some other mechanism of saving the changes (different than using the UpdateUrl option and saving the changes in the related Action on the server) you could directly get the transactions on the client side (http://help.infragistics.com/jQuery/2015.1/ui.iggrid#methods:pendingTransactions ) and send them as part of the request to your Edit ActionResult method. Note that the method for deserializing that data would be similar to the one demonstrated in the online sample : http://www.igniteui.com/grid/basic-editing For example: GridModel gridModel = new GridModel();List<Transaction<Order>> transactions = gridModel.LoadTransactions<Order>(HttpContext.Request.Form["ig_transactions"]);
I hope you find my information helpful.
Pleas let me know if you need any further assistance with this matter.
Sorry, I realized that I should probably mention that I'm working with version 2014.2 as that might have an impact.
Thank you for your clarifications.
I will investigate your requirement further and I will get back to you as soon as I have any new information regarding this matter.
Please feel free to continue sending updates to this case at any time.