Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

What approaches can we use when working with child tables in a datagrid control?

$
0
0

We've got several tables in our SQL Server database, that are in a parent-child relationship. Displaying the data from the parent table on the window is easy. And I don't think it would be too hard to display data from a child table that is data bound to a datagrid. What is harder to do is how do we display data in some of the columns of the child table, when that data is actually resolves to a lookup table? For example, we've got a parent table named Legal. Then a child table named Charges. For simplicity sake, the parent table only has ClientID in it, which is the primary key. The Charges table has ClientID and ChargeID, which comprise it's primary key, plus another column for the number of times that client has been charged. Thus, for example, a couple of rows from the Charges table may look like this:

ChildIDChargeIDCount
12342
12371

However, clearly I don't what the user to try and memorize all of the charges and their related ChargeID, those are in a lookup table. So how to I relate the lookup table to the ChargeID for the records in the Charges table, that is data bound to a datagrid?

I don't know if this will make any difference or not, but we're also using entity framework 4.2, for a data access.


Rod


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>