Hi
I am (still) creating my first ASP.NET MVC 4 website and am using the igGrid on one of my pages.
I have the grid updating via the UpdateURL property - I can carry out CRUD operations on grid data without a hitch, I even get the IDs for new rows returned to grid rows.
I now need to have some other fields on the same page and I need to update them at the same time that I update the grid.
The fields are set up against properties in my model but I can't figure out how to access the model properties from the controller method that runs via UpdateURL.
Is this possible and, if so, can you give me a pointer as to how? As far as I can tell the controller method does not have access to the page's Model and neither does the GridModel.
It feels like I missing something obvious to the more experienced.
Thanks,
Graeme
I have had to settle for a two stage update process (shame I can't get it all into a transaction) by implementing the post back of the form on which the grid & other textboxes lie in addition to using the UpdateURL to save the grid data.
One Save button press will carry out a post back of the text box data and also action the UpdateURL controller method to save the grid data.
Untidy, but will have to do for now. There must be a better way, but I can't find it.
Hi Graeme,
I am updating this to let you know I am researching and working on a sample to help demonstrate a method to achieve this.
I will need a little more time to look into this. I will have another update for you by Wednesday.
Hi, the example you provided here is almost perfect for me except for one thing: it does update the database on every single update to the grid.
1) How to catch all the new, deleted and modified rows and then send all that and all the other data out of the grid in one step?
2) How to do that with a igHierarchicalGrid with two levels (parent-child rows)?
3) How to do that using razor and C#?
I know I am asking too much but your answer will make many developers very happy :)
Thank you.
I has taken me a while to get back to this but I can at last confirm that the example you provided works nicely. Thank-you very much for your help.
Regards,
Hello Graeme,
Please let me know if you have any other questions or concerns about this issue and I'll be glad to help you.
You can always find more information on how to set up our controls in our documentation. Our documentation points out how you should configure the HTTP handler and module for IIS6 and IIS7 here:
http://help.infragistics.com/doc/jQuery/2013.1/CLR4.0?page=igUpload_Overview.html
http://help.infragistics.com/doc/jQuery/2013.1/CLR4.0?page=igUpload_Using_HTTP_Handler_and_Modules.html
As for my sample, you can enable NuGet package restore for the solution and NuGet will download the standard required packages. Afterwards, you will need to update the project References to the Infragistics.Web.Mvc.dll to the version you have installed and maybe update the javascript and Css references in my Home/Index view. If this still does not work, the Home controller and its views along with my model I created for it should be easily portable into another running project.
Once you get back to this and if you need further assistance, please let me know.
I couldn't get it to work. To be honest I am finding myself in this position often.
It takes a while to get the right info from your resources as it is spread across more than one resource - eg I couldn't get your example to run up so I have to try to move the right bits into my app and then play spot the difference with all related files in both projects. I usually get there in the end but have had to work on other aspects of my system for the time being. I will come back to it as it seems straight forward.
For another example - I was trying to get the file upload to work recently and found it a real struggle until I stumbled across a forum post that said I had to put an entry into my web.config for the module "IGUploadModule" to register it for IIS6. It would be good for the sample to mention this, at the top, in red, as I wasted hours looking for the answer.
I had it in system.webserver (This is where it needs to be for production) but it had to be in system.web for development. I probably haven't read the right "starter" documentation.
I'm sure that it is something similar preventing me from getting this going so I have not given up and will return to it later.
Once I get each widget working they are most excellent so I am very pleased to have them in my arsenal.