1

Using Settings Editor I created some user settings for my application. In one specific instance, I need a setting to be an array of strings. The only option I encounter is StringCollection:

Choosing the data type in settings editor

When I edit the content while still in Settings Editor (clicking on the three dots) a simple editor gets invoked, where I can enter my strings, line by line:

String Collection Editor

I created a simple form for my users to edit those settings, creating a PropertyGrid and tying it to the default settings:

propertyGrid1.SelectedObject = Properties.Settings.Default;

When I edit the StringCollection there, I get a different String Collection Editor: Run-time String Collection Editor

I can edit or remove the entries just fine, but if I try to add one, I get the following error: "Constructor in type 'System.string' not found".

Is there a simple way to have property grid use the same editor the design-time editing of the Settings does?

Jan Schultke
  • 17,446
  • 6
  • 47
  • 96
B_K
  • 11
  • 1
  • You have to use custom object with properties and assign editor via attribute. See [this question](https://stackoverflow.com/q/46099675/1997232). I don't know which editor is this modal window with multiline string. – Sinatr Aug 19 '20 at 07:07

0 Answers0