I have at my disposal:
- The main form that contains the DataGridView.
- Additional form where I enter the data of the object being created
- Class library
On the main form there is a button "AddObjectButton", clicking on which opens an additional form. In an additional form, after entering data about an object, clicking on the "Add object" button invokes the object constructor described in the class library. This object is added to the collection (List <>), which is a static member of the Home Form class. After that, the data entry form closes.
Task: with the appearance of new objects in the collection, to display their presence in the DataGridView. If I understand correctly, then you can create an event that will respond to the creation of the object and call the method of displaying this object in the DataGridView.
Tell me how to implement it.