Hello,
I need some help here, I will try to explain my
situation in hope someone will can assist :
2 DataTables with Relations, 1 DataGrid on the form, 1
ListBox on the form. According the SelectedItem in the
ListBox the data on DataGrid is changed (by using the
Relations).
The DataBindings is working perfectly (
DataGrid.DataBindings was set on the that Relation).
The Problem : User add new item in the ListBox and then
try to add new item to the DataGrid for the new item in
the ListBox. The item will not appear in the DataGrid
until I will change the item in the ListBox to other item
and select again the new one.
For Example : 1 DataTable for Shops, 1 DataTable for
Customers, Relation between Shops.SHOP_ID to
Customers.SHOP_ID.
DataGrid.DataBinding set to that Releation,
ListBox.DataSource set to DataTable of SHOPS.
This way every click on the ListBox will display the
Customers of that shop in the DataGrid
Until here it's working perfect.
The Problem occur when I'm trying to write this code :
DataRow dr1 = dtShops.NewRow();
dtShops.Rows.Add(dr1);
DataRow dr2 = dtCustomers.NewRow();
dtCustomers.Rows.Add(dr2);
dr2["SHOP_ID"] = dr1["SHOP_ID"];
This code should display new item in the ListBox and new
item in the DataGrid, but unfortunately the item in
DataGrid can't display. If I want to it - I must change
the item in the ListBox for other item and get back to the
new shop I entered.
Can it be bug in VS.NET ?
10x.