Click here to Skip to main content
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 7:41am
Edited 26-Jan-12 9: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 OriginalGriff 195
1 ProgramFOX 130
2 Maciej Los 105
3 Sergey Alexandrovich Kryukov 105
4 Afzaal Ahmad Zeeshan 82
0 OriginalGriff 6,564
1 Sergey Alexandrovich Kryukov 6,048
2 DamithSL 5,228
3 Manas Bhardwaj 4,717
4 Maciej Los 4,150


Advertise | Privacy | Mobile
Web02 | 2.8.1411022.1 | Last Updated 27 Jan 2012
Copyright © CodeProject, 1999-2014
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