سؤال

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?

هل كانت مفيدة؟

المحلول

I found the reason why you can not edit,

because each value in a list is an object you can not edit it,

even though I put in GetValue one value from the object.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top