Let's start with the procedure.
Main form, two subforms, a, B. Inside the panel that is embedded in the main form
Main form, start the lookup method in Class C, find the value, send to form a by event delegate
The C class also modifies the query table and sends the modified query table through the event delegate to form B.
The program runs the first pass, the steps, the main form query, and the A/b form is displayed normally.
The second time, the a form is displayed normally, and the B form does not display properly. Content not updated
AB window is a DataGridView control
The second reason for the failure is that the B form is passed by the Class C driver, the Class C is not a class with the main form, the content is updated and the DataGridView is not updated, and the DataGridView is updated by datasource the data source bindings, Modified data source, re-assignment is not updated, there are related articles on the Internet, as for a
The second time the form succeeds, it may be the main form directly driven. I can't explain the specific reason.
The problem is on the DataGridView update, through DataGridView. Rows.clear (); Prompt data source binding method assignment, is not able to be deleted through the market, so I in the B form below the class used Datagridview=null, and then datasource= the new data source. Result problem solved,
As for a why not NULL update success? Still some don't understand, is it associated with the update mechanism of the main form? Look forward to a view
I looked again. The properties of the DataGridView list in the B-window are displayed normally for the first time, and the second has no corresponding situation
Table for first query
Table for second query
The property of the B table is the second time "sweep quantity" becomes "Quantity", which is the number of data sources bound
B DataGridView Properties of the second case number
Is there a problem here that doesn't correspond?
Unify the two above and not assign NULL to the B list. The result is still not updated. Should be related to the update mechanism of the main form.
C#datagirdview, assign a value in DataSource mode, and then update the problem