Click here to Skip to main content
12,394,971 members (65,117 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# Ajax MVC jQuery NHibernate , +
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 26-Jan-12 6:41am
Updated 26-Jan-12 8:09am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Not quite sure what exactly your problem is. Perhaps this Phil Haack article might help you greatly.Using jQuery Grid With ASP.NET MVC[^]
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

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.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.160721.1 | Last Updated 27 Jan 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100