Have I DataBinding or DataRelation problem?
-
Hi everyone! In dataset "dsbasis" I have table "ShopGood". I have another table "Good" which don't belong to dataset and contains only important data of ShoopGood for show in datagirdview. I add this table to dataset and I create relation betwen this two tables. I also have more textboxes bounded to dataset and datatable "ShopGood". My problem is, that when I change position in datagrid, values in textboxes stay unchanged. Can anybody tell me why? If I set datagrid datasource to the table which textboxes are bounded all works fine. My code: DataTable dTable = new DataTable("GoodTable"); // fill datatable for datagrid dTable = dShopGood.ListOfGood(""); // set datasource dgrShopGood.DataSource = dTable; dgrShopGood.DataMember = ""; // create datarelation betwen datatable shown in datagridview and // table ShoopGood in DSBasis dsbasis.Tables.Add(dTable); dsbasis.Relations.Add("rel_ShopGood_GoodTable", dTable.Columns["ID"], dsbasis.ShopGood.Columns["IDGood"]); // set databindings txtMark.DataBindings.Add("Text", dsbasis, "ShopGood.Mark", true); txtName.DataBindings.Add("Text", dsbasis, "ShopGood.Name", true); // fill dataset for bounded textboxes dShopGood.CRAllDetail(dsbasis); Thanks in advance, Jure :confused: