Display a collection in a PropertyGrid control

I have an array of objects containing pairs of string labels and values, how would I put them all in one property grid?

public class stringVariable { public String name; public String defaultValue; public String value; }; public List<stringVariable> variables = new List<stringVariable>(); 
+4
source share
2 answers

Adding an array of objects to the property grid is pretty well covered in a number of tutorials. This should be what you are looking for.

0
source

This is not entirely straightforward, but possible. You should have a class that implements ICustomTypeDescriptor that tells you what properties to display, etc. There are several implementations I used this one: http://www.codeproject.com/KB/miscctrl/bending_property.aspx

+3
source

All Articles