Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Nov 15, 2012 06:36 PM by CodeHobo
Nov 15, 2012 01:20 PM|LINK
I have a page which contains a 1 Form (for table 1) and a Telerik Data-Grid (table 2) , table 1 id has a relation in each table 2 data added. Lets say form 1 contains a field for Name and the telerik-grid contains Telephone No., it could be multiple so in
the grid i have a CRUD( pointed to table 2),. and in overall i have a save button.
my question is, how will i know that this table 2 data is for table 1( which is just im about to create when i press the save button),
this is really giving me a hard time. i was hoping for your immediate response to this issue, i don't have much time. T_T
Thank You so much.^^
Nov 15, 2012 06:33 PM|LINK
I'm not 100% sure on what your question is so show an example if you can. If you're wanting to only submit one set of the fields, move the unwanted fields outside of your form. There are other ways to bind multiple models as well and display/gather on the
form too. One way is creating your own elements and not using HtmlHelpers and specifying a specific name tag. When the form posts, your controller will try to match that name with a property in your Controller arguments or properties in a class.
Nov 15, 2012 06:36 PM|LINK
It sounds like you need a view model, take a look at this page (it's old but the concept it still the same).
Essentially you create a class that has properties for both of your models , then bind the page to this class. You can access both models now int the View.