views:

129

answers:

1

Is there a way to display and edit values in the PropertyGrid (and his CollectionEditor) of an object, which is derived from an abstract generic class? I don't get the properties displayed only something like this: "IFilter´1" or "BaseFilter'1" Where IFilter is an Interface, and BaseFilter an abstract class.

All objects contained by this list:

List<IFilter<bool>> _activeFilter = new List<IFilter<bool>>();

There is one abstract class, implementing the IFilter:

public abstract class FilterBase<T> : IFilter<T> { ... }

And a few specialized implementations of the FilterBase

    public class SimpleBool : FilterBase<bool> {

    public bool BoolValue { get; set; }

    protected override bool Process(bool input) {
        return input && BoolValue;
    }
}

When I add such a "SimpleBool" class to the above defined list, the PropertyGrid wont display any of the Properties. But it displays all correct when I define an Generic List with a non generic Type.

Is there an Solution to get this work? I tryed to add some TypeConverter and an own CollectionEditor. Obviously without luck =(

A: 

I have solved it. But its strange.. Just add some Property to the abstract class "FilterBase", thats all.

chriszero