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 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.
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.
Hello!
I think the information you gave above is not correct. IDerivedInterface has the information of the properties of IBaseInterface. You can use IBaseInterface properties through IDerivedInterface. I have the same problem with my grid as the original author. It seems that the designer uses only the properties from the interface given, not the inherited properties of the interface.
For example when I define new interface IDerived from two base interface and not adding any properties like this:
public interface IDerived : IBaseInterface1, IBaseInterface2 {}
the designer does not show any properties as IDerived has only the properties of the two bases.