Hi,
I have a need to display a list of customers and their orders - which I can do simply with the UltraWinGrid as per the NorthWind example. What I now need to do is extend this so that for each Order, also display the product that is being ordered (lets assume that there is only one product per order).
The FK relationship is between Customers -> Orders and Products -> Orders. (as opposed to Orders -> Products which would probably make UltraWinGrid happy)
Is there a simple way to use the UltraWinGrid control to include the product data in its presentation?
(I am referring to the NorthWind data set for simplicity)
thx
This isn't something you can do in the grid. You would have to do it on the data source. In other words, you would have to set up your data source with a structure such that the Products are directly under the orders table.
I'm pretty sure there is a way to build such a structure with SQL, although I must admit, I'm a bit rusty and don't remember exactly how to do it.
Another option you might consider is using an UltraDataSource in on-demand mode. The basic approach would be to set up the UltraDataSource with two bands: Orders and Products. The UltraDataSource will fire events when it needs data for a row and you give it the data from your real data source. There's a sample called the Virtual Mode Sample included with the NetAdvantage SDK that shows how to use an UltraDataSource on-demand.