Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1530
Display relational data - How?
posted

Hi all,

I use data of two tables e.g CUSTOMER and ORDERS where ORDERS.custID relates to CUSTOMER.ID

Is there a way to use ORDERS as root table and the xamDataGrid fetches via the relation the name of the customer automatically from the CUSTOMER table and show it in the grid column 'Customer' instead of the CUSTOMER.ID from table ORDERS.

How do I define that relation in the xamDataGrid?

Btw: My DataSource is a ListCollectionView filled via Entity Framework query

 

Thank you!

 

 

  • 9694
    posted

    I apologize that no one has yet answered this post. We were inundated with more posts than we had resources to cover. Since that time we have been adding people to the task of making sure every post gets a reply from an Infragistics employee.

    The problem is that you cannot bind two different collections to the XamDataGrid. However, you can get what you want. The most straightforward way would be for you to create the ViewModel Order class your self which would contain a Customer property. This collection bound to the XamDataGrid would then have the Customer info as its own Column.

    You could also add an UnboundField for Customer and programmatically set the data for the Customer field for each Order. This approach would not be as clean.

    Another option is to check out the new Pivot Grid in our Data Visualization version of NetAdvantage for WPF. This grid is designed to work with relational data.

    Thank you!