How can I automatically expand an ExpandableObjectConverter object in a PropertyGrid?

I have a .net PropertyGrid. I select an object to view, and the property of this object is Vector3. I can use ExpandableObjectConverter to automatically display Vector3 properties in a PropertyGrid. Everything is fine, except that when choosing an object I would like Vector3 to be expanded by default, i.e. You can see X, Y and Z without pressing [+]. How can i do this?

// Managed C++ : [TypeConverter(ExpandableObjectConverter::typeid)] public ref struct Vector3 { Vector3(float _x, float _y, float _z) : x(_x) , y(_y) , z(_z) {} float x, y, z; property float X { float get() { return x; } } property float Y { float get() { return y; } } property float Z { float get() { return z; } } }; 
+4
source share
1 answer

The answer is mainly provided here: Expand the C # property grid when showing

To find a specificc property instead of a category, only minor changes are needed.

0
source

All Articles