views:

94

answers:

2

WinForms databinding has very solid support for navigating related DataTables via DataRelation objects, but I'm having a difficult time finding resources for implementing similar functionality for databinding against a business object.

Does anyone know of an equivalent to the DataRelation object, or know of any resources on implementing equivalent functionality, for databinding to an object with related items?

A: 

If I understood you correctly and you are looking for kind of master-detail BO relations I think you can find tip in my post you already answered :)

    // create binding sources
    BindingSource bs1 = new BindingSource(Persons, null);
    BindingSource bs2 = new BindingSource(bs1, "Parents");

    // bind to grid
    dataGridView1.DataSource = bs1;
    dataGridView2.DataSource = bs2;
Maciej
A: 

Without going into the details of your particular application the following title is an excellent resource for databinding in windows forms as it relates to business objects. One will find the information you are looking for in 9. Implementing Custom Data-Bound Business Objects and Collections.

Murray Van Wieringen