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
505
Binding to Derived interface with UltraWinGrid... Base interface member don't show up in designer
posted

Hello,

 

I am using the UltraWinGrid.  I specify the data source as an interface.  In the form load event I set the datasource to an instance of a class that implements this interface.  The cl***ructure looks like this:

public

 

 

class DerivedClass : BaseClass, IDerivedInterface

class BaseClass : IBaseInterface

IDerivedInterface : IBaseInterface

The problem is that the properties defined in IBaseInterface and implemented in BaseClass (that DerivedClass inherits) don't show up in the designer under  Band & Col. Settings->Columns.. Thus I can't remove them and they show up in the grid.  How does one handle this?  I believe I can solve the problem by specifiying the bindingsource as DerivedClass rather than IDerivedInterface but I'd rather not do this as the real project has several class that dervice from IDerivedInterface and could be used.

Suggestions?  I have attached the very simple demo project that displays this behaviior.

Thanks.

GridDemo.zip
Parents
  • 17259
    Offline posted

    Interesting problem... although it tells you that interface "Inheritance" is not like class inheritance. The properties of IBaseInterface don't belong to IDerivedInterface. It just say: "if you're going to implement IDerivedIterface, please implement IBaseInterface too". As another proof, you can explicitly implement IDerivedInterface. You can see that properties of IDerivedInterface are implemented like:

    bool IDerivedInterface.DerivedProperty1

    but properties of IBaseInterface are implemented as:

    bool IBaseInterface.BaseProperty1

    The only option I see here if you want to keep binding to interface type, break the interface "inheritance" and copy properties to IDerivedInterface. In the class, one property can serve both interfaces.

Reply Children
No Data