Sharing dataset in 2 user controls

Mar 28, 2008 at 11:04 AM
I m new to SCSF and Window Deveopment

I have created two user controls. In 1st usercontrol i placed a grid and bound it using Bindingsource. In my second user control i created a edit form and bound it using the another Bindingsource. I want to share same dataset between these 2 user controls.

What i am doning is created a class with two properties in it. One of type Dataset and second of type Bindingsource And passing this class using Event Topics. Is this method is correct? If not then wht will be the method to do so.

When selected index of grid is changing i am rasing an Event Topic and passing my class in that and in second user control it is binding the form. My problem is I want to check first if form is validated then the new selected record will be shown and if Form is not validated then the form will display the old record being edited and grids selected index will also not to change in that case.