Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以在 PropertyGrid 控件中显示对象的所有成员和子成员值?
一层之后,只显示成员类型名称,而不是带有成员值的新节点。
如果您不拥有描述类的代码并且无法向其添加属性,则可以添加ExpandableObjectConverter与泛型关联的object。
ExpandableObjectConverter
object
TypeConverterAttribute ObjectAttribute = new TypeConverterAttribute(typeof(ExpandableObjectConverter)); TypeDescriptor.AddAttributes(typeof(object), ObjectAttribute);