DataGrid & DataRelation
-
Hey all, I have DataRelation object between 2 tables & 2 DataGrids. for some reasons, I delete the relation, activate an operation on the tables & then create the relation back. here is some code: //before the operation starts: Ds.Relations.Clear(); Ds.Tables["Cust2"].Constraints.Clear(); //after the operation DataColumn dc1 = Ds.Tables["Cust1"].Columns["Id"]; DataColumn dc2 = Ds.Tables["Cust2"].Columns["Id"]; DataRelation Dr = New DataRelation("cust1to2", dc1, dc2); Ds.Relations.Add(Dr); everything is ok until now. but when I tried to connect the tables to the datagrids: DtGrd1.SetDataBinding(Ds, "Cust1"); DtGrd2.SetDataBinding(Ds, "Cust1.cust1to2"); I get the exception: "Cannot have a relationship between tables in different DataSets" does anyone know what is going on?? thanks RoyRose