Hi all i am doing an application in win forms
I am having a small issue i.e i am having my main form as
Tree view, panel and a data grid. I am having some user control forms.
When i select a node from tree view corresponding user control will be get loaded in the panel if main form. This works good.
Now for the child nodes i am having some text files attached when i click on that i will display the data grid along with the data present in the text file. This also works fine.
But now when click on data grid cells i would like to show the data in the user control form .
Can any one tell how to handle the controls from particular user controls that was displayed
The best approach is to use event-handlers as a publisher-subscriber paradigm.
In your publisher you use
public event EventHandler FlightStarted;and having a EventArgs class:In your publisher class you use an OnSomething-method to fire off the event.
Now you need to have a subscriber as well:
and the method
More to read here: Event Tutorial C#