Say you have three or four related tables, and you want to display each table in a
separate Windows DataGrid and of course, have the relationships be respected in each Grid.
Here's how to do it:
First, assume the following DataSet and relationships:
dataset: myDS
relation 1: relationTable1_Table2
relation 2: relationTable2_Table3
relation 3: relationTable3_Table4
Then, your DataGrid bindings would be as follows:
dataGrid1.SetDataBinding(myDS,"Table1");
dataGrid2.SetDataBinding(myDS,"Table1.relationTable1_Table2");
dataGrid3.SetDataBinding(myDS,"Table1.relationTable1_Table2.relationTable2_Table3");
dataGrid4.SetDataBinding(myDS,"Table1.relationTable1_Table2.relationTable2_Table3.relationTable3_Table4");
from a solution provided by Çetin Basöz in Message #1069287
|