0

I have a list in Propertygrid that opens by expander. I created it using the following site: Customized display of collection data in a PropertyGrid.

I added this Editor Type to cancel the Collection Editor:

class MyEditor: UITypeEditor
{
    public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
    {
        return UITypeEditorEditStyle.None;
    }
}

[TypeConverter(typeof(ExpandableObjectConverter))]
[Editor(typeof(MyEditor), typeof(UITypeEditor))]
public class MyCollection : CollectionBase, ICustomTypeDescriptor
{...}

The problem is you can not edit the values ​​in the collection via the Expander.

I have two questions:

  1. Why the Expander appears as disable editing?

  2. How can I allow the user to edit via Expander?

4

1 回答 1

0

我找到了无法编辑的原因,

因为列表中的每个值都是object您无法编辑的,

即使我GetValue从对象中输入了一个值。

于 2013-04-11T11:03:24.447 回答