This project has moved. For the latest updates, please go here.

PropertyGrid: Binding to a property of the parent container

Jan 24, 2013 at 10:08 PM

I am using the property grid to display an object containing expandable properties. Here's what I can't figure out...

I have defined an alternate editor for one of the expandable property's property. In addition to binding the editor to the value of the corresponding property, it also needs to bind to another property of the parent property, or in other words, its sibling property. The latter is what I can't figure out. 

Visually...

object A

     prop 1

     prop 2  <- expandable

         prop 21

         prop 22  <- this property's editor also needs to bind to "prop 21"

Any ideas or suggestions? Thank you in advance.

Feb 5, 2013 at 12:50 PM
The PropertyItem has an "Instance" property that contain the value of the "source value".
So in your case, The PropertyItem for "prop 22" has it's "PropertyItem.Instance" property equal to the value of "prop 2".

Hope this will help
Feb 5, 2013 at 4:43 PM
Thank you for the response.

I've actually tried using the "Instance" property but it refers to "object A". My toolkit version is 1.6. Are you aware of any changes to later versions with regards to the value of the "Instance" property?

Again, thanks.
Feb 5, 2013 at 5:41 PM
Absolutely, v1.9 will refer to the value of the immediate parent instead of the root object.
Feb 5, 2013 at 9:45 PM
Got the latest code, and it works. Thanks.