Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
I'm currently working with two tables that I'm accessing through NHibernate entity framework: - Invoices - InvoiceItems

I need to create an Invoice Items report and include the Invoice table infomration on it as well.

The two tables are connected by InvoiceId. To populate my report data I created a model for the JQGrid that's connected to the "InvoiceItems" data model ( that's where I get the data from ).

My problem is that I can't seem to figuire out how to populate the "InvoiceItems" report with the "Invoice" table field values. Errors such as [Property 'InvoiceDate' not found on Namespace.InvoiceItems] or just [NaN NaN] keep showing up in columns where the information from the parent [Invoices] table should be. I tried using 'InvoiceItems.Invoices.InvoiceDate' syntax for example to map the grid colNames to data names but it doesn't work.

So how can I map the "Invoices" table fields to the grid model that returns fields from both "Invoices" and "InviceItems" data models ?

Thank you in advance.
Posted
Updated 26-Jan-12 8:09am
v2

Not quite sure what exactly your problem is. Perhaps this Phil Haack article might help you greatly.Using jQuery Grid With ASP.NET MVC[^]
 
Share this answer
 
I was able to solve this by creating a new model and returning the jQresult to the jqgrid with that model which is a combination of 2 other classes.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900