When I select the object so it is shown in a PropertyGrid, it, shows the
default collection editor. So far, so good. When I go to add a value, the
collection editor complains that it can't find a constructor for type
System.String.
That makes sense to me, given that a string doesn't have a parameter-less
constructor.
Does anyone know of a quick-and-dirty way to have an editable property of
strings that will cooperate with the default collection editor in the
fashion I would like? I want to know If I am overthinking it before I create
a custom TypeDescriptor and a custom CollectionEditor.
Any help is appreciated.
Thanks in advance.
WALDO
if you want to get the true string collection editor, decorate your
property with:
[Editor("System.Windows.Forms.Design.StringCollectionEditor,
System.Design, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a",
typeof(System.Drawing.Design.UITypeEditor))]
Or else, if you want to fix the generic collection editor, implement
something like described on this page:
http://www.dotnet247.com/247reference/msgs/30/153300.aspx
The method CreateInstance of your editor must return an empty string.
Best regards,
Nicolas Cadilhac @ VisualHint (http://www.visualhint.com)
Home of Smart FieldPackEditor.Net / DateTimePicker replacement
Home of Smart PropertyGrid for .Net and MFC
Microsoft PropertyGrid Resource List - http://www.propertygridresourcelist.com
On Jun 1, 4:59 pm, "WALDO" <NOS...@NOSPAM.com> wrote:
> I have an object which I would like to show on a property grid. The object
> has a property that ultimately can boil down to an array of unique strings.
> I though I'd be clever and code it as a Generic.List(Of String).
>
> When I select the object so it is shown in aPropertyGrid, it, shows the
Imports
System.Drawing.DesignPublic
Class PathCollectionEditorPublic
Class FolderPathEnd
ClassPublic
Class PathEditorEnd
Class