Fog Creek Software
Discussion Board




Welcome! and rules

Joel on Software

Binding objects to relations

Hi All,

We have a VB.NET project where a DataGrid should contain both the header and details of an object. For example, we have an object model for an OrderHeader. It contains OrderDetails (which is a collection of OrderDetail objects).

Ideally, the grid would display all of the OrderHeaders, and when a user clicked on a specific row, it would expand to display the details.

I've done some searching on Google, and found something similar where the author used the DataSet.Relations.Add() method, and bound it to the grid. Which works great if we pull directly from the database. However, all of our UI access is through objects, not direct calls to the database.

Can anyone provide some insight as to the best way to tackle this?

CF
Wednesday, February 25, 2004

You can write binding objects for the grid, which tell it how to display things. We use grids all the time with collections of direct objects, and this is how we do it.

Brad Wilson (dotnetguy.techieswithcats.com)
Wednesday, February 25, 2004

*  Recent Topics

*  Fog Creek Home