Hi guys,
We are just starting to have a play with the Syncfusion MVC components and I have a question about posting data back to the controller.
We have been using our own form controls for a while now, so binding data to a model and posting back to the controller has been quite easy. EditorFor's etc used and all properties are set when the form is submitted back to the controller. Using our own controls and editor templates mean we have a lot of control over the flow between the view and controller.
Now we are having a bit of play with Syncfusion, I'm struggling to find an example or doco to get the data bound properly to models when posting back.
An example of the sort of thing we would usually do:
- Model with a number of properties, some of which could be a list of objects
- View with a form with EditorFor's for the basic properties (boolean, strings, ints etc). A for loop to loop through the list items to create editors, which results in the correct name being used in the html input control and therefore the model binder will pickup the values and they will be present in the model when it is passed back to the controller. The view will have a submit/save button at the bottom of the form to submit the data back to the controller.
- Controller that has a post action that accepts the model. From here we do a DB store, or manipulate the model etc.
Obviously that is very high level...
So far I haven't been able to find a good example of binding data to a complex model from a data grid and passing it back to controller. I've seen some examples where people use ajax to build a string of the data grid to send back to the controller and another example where a list of changed models were passed back, but the actual values seemed to be missing.
I suppose I am after:
How to properly create a grid from a list item that allows bulk edit and then send back the whole grid in custom model
Is it possible to have a form with several items, including a grid, with a submit/save button and the form is submitted to the controller with all properties, including the list items from the grid, populated.
Thanks and hopeuflly that makes sense :)