I’m trying to use the property grid in the designer for Visual Studio.
I have a list of classes that I want the developer to be able to add to at design time so that the user can have access to extra features.
Here is some example code of what I have in the code already. The problem is when the developer goes to the design mode he can only see that there are x number of values in the list, but is unable to see any of the details. When trying to add a new item to the list the user is presented with an error.
Constructor on type ‘EditorTextBox+SyntaxRegex’ not found.
Now the code:
private List<SyntaxRegex> _syntaxRegexList = new List<SyntaxRegex>();
public class SyntaxRegex
{
public string title;
public string regex;
public Color color;
}
Public List<SyntaxRegex> SyntaxRegexList
{
get{_syntaxRegexList = value;}
set{return _regexList;}
}
You need to add type converters / editors; a good start would be to add:
above each
classdefinition. For example, the following works fine (note I changed to properties, removed the list setter, etc):The specific error message also makes me wonder if your actual type is public with a public parameterless constructor (the fact that it doesn’t compile makes me suspect you haven’t posted the actual code…)