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
Many to Many - One to Many CRUD operations using the WebHierarchicalDataSource and WebHierarchicalDataGrid Training


Have you got any real world example of how to use the WebHierarchicalDataSource, WebHierarchicalDataGrid and the Entity Framework to perform CRUD operations when using many to many and one to many relationships?

All the tutorials I have seen so far only use one table. This is not a real world example.


In the Northwind database we have the Orders, OrderDetails Products and categories tables. The OrderDetails table work as a mapping table even though it has more fields like UnitPrice, Quantity and Discount. So we have a many to many relationship Orders-OrderDetail-Products like this:

Orders---------> OrderDetails <--------Products<--------Categories.

1 - Can we use the Infragistic WebHierarchicalDataGrid and WebHierarchicalDataSource with the Entity Framework 4.0 so that we could create a grid and display all the related entities?

2 - Could we use CRUD operations on the grid? Would the WebHierarchicalDataGrid and WebHierarchicalDataSource know how to send the updates, insertions, deletes and using filters with the entity framework?  

Example: The grid would display the following:

OrderID, OrderDate, Freight, ShipName, ShipCity (from Orders)

UnitPrice, Quantity, Discount (from OrderDetails)

ProductID, ProductName, CategoryName, Description (from Products and Categories)

3 - If I updated the CategoryName and save, will it be saved to the right Category table?

4 - What about to create a new record using all tables? what is the best way?

This is the kind of tutorial I think you should be creating to help people like me that use the Infragistic controls.

Could you please provide a sample code for the scenario described above?