Click here to Skip to main content
Rate this: bad
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 7:41am
Edited 26-Jan-12 9: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
0 Sascha Lefévre 485
1 Sergey Alexandrovich Kryukov 325
2 Maciej Los 240
3 Abhinav S 164
4 Peter Leow 120
0 Sergey Alexandrovich Kryukov 6,953
1 OriginalGriff 6,311
2 Maciej Los 2,732
3 Peter Leow 2,674
4 Abhinav S 2,562

Advertise | Privacy | Mobile
Web01 | 2.8.150414.1 | Last Updated 27 Jan 2012
Copyright © CodeProject, 1999-2015
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