Use base BindingSource as derived Form datasource

389 Views Asked by At

I have a base Form that has a public BindingSource property, named "BaseSource". Its DataSource property is set to a business object type.

I thought that if I created a derived form from it, in the designer I would have access to "BaseSource" and that it would allow me to bind the derived form's controls to my business object's properties.

Is there something special I must do so that the designer sees the "BaseSource" instance like just any other BindingSource object dragged into the designer's component tray?

UPDATE:

I tried the ideas mentioned in the comments below (thanks for the feedback) but unfortunately I couldn't make it work. I've used and two projects, one holding the base form and the business object class, the other holding the derived form. Base form exposes a protected property named BaseBindingSource of type BindingSource. In the base form's constructor, I set that base binding source's DataSource property to a new instance of List<BusinessObject>. The projects compiles without issues but in the derived form's designer I still cannot reach out to BaseBindingSource as an usable data source.

Making this property public didn't help either.

0

There are 0 best solutions below