Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1960
Missing fields setting BindingSource.DataSource to an extended interface
posted

Hello,

I'm binding my grid to a BindingSource. BindingSource.DataSource points to an interface "IMyInterface2", which extends another interface "IMyInterface".

At design time I only see the columns corresponding to properties of IMyInterface2. The properties of IMyInterface are not there. I think it should show every property from IMyInterface and IMyInterface2.

Furthermore, at runtime all the properties from IMyInterface and IMyInterface2 are there. That's very weird.

Have you seen this behavior?

Thanks.

Parents
  • 1960
    posted

    Just to make myself clear, the implementation would look like this:

    public interface IMyInterface

    { string PropertyA {get; set;}}

    public interface IMyInterface2 : IMyInterface

    { string PropertyB{get; set;}}

    Then I set the BindingSource.DataSource to IMyInterface2.

     At design time I only see PropertyB. At run time both PropertyA and PropertyB are bounded to the grid.

Reply Children