Click here to Skip to main content
11,647,600 members (62,955 online)
Rate this: bad
good
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
Edited 26-Jan-12 8:09am
v2
Rate this: bad
good
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[^]
  Permalink  
Rate this: bad
good
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.
  Permalink  
v2

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

  Print Answers RSS
0 jyo.net 500
1 F-ES Sitecore 370
2 DamithSL 335
3 OriginalGriff 322
4 CPallini 290
0 OriginalGriff 1,277
1 jyo.net 994
2 DamithSL 946
3 Sergey Alexandrovich Kryukov 853
4 CPallini 760


Advertise | Privacy | Mobile
Web02 | 2.8.150804.2 | 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