First of all, I want to apologize for:
- The software is in Portuguese.
- The software is ugly as hell. It is for a school project and we decided to focus more on the funcionality than the design (I know, it's wrong, but we had to choose...)
- I read update combobox from another form in c# but I didn't understand what happened.
That said, let's go to the issue.
I have this window:
If I click the button marked in red:
This will open:
This is supposed to be a software for a market. The first window is responsible to order more thing to the inventory. The second window is responsible to add a supplier into the system.
The combobox shows all the suppliers on the system. I want when I finish adding a supplier on the second window after I clicked on the button highlighted with the red rectangle, the combobox will update automatically with the new data.
I used a "Update" button with this code:
this.tb_FornecedorTableAdapter.Fill(this.tccDataSet.tb_Fornecedor);
It worked, but I tried to use on FormClosing
, FormClosed
and Deactivate
events on the other windows and it didn't work at all (I modified the "this" on the code to a lot of this and it didn't help me). Is there a way to do what I want?