Creating nested property items

Grids for WPF Forum

Posted 12 years ago by Tim Schattkowsky
Version: 12.1.0561
Avatar

Hi,

I would like to create nested property items in my IDataFactory implementation just like the two default implementations do.

Still, I have no idea to do this since IPropertyDataAccessor seems to provide me no way of nesting these items.

How can this be done?

Best,

Tim

Comments (3)

Answer - Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Tim,

DataFactory.GetProperties and IDataFactory.GetDataAccessors should get called once for your SelectedItem, and then again for each IPropertyDataAccessor you return from that call. In the subsequent calls you can then return IPropertyDataAccessors for any complex objects, which should give you the nested behavior your're looking for.

If you're implementing IDataFactory, you may want to instead consider subclassing DataFactory, as you can use base.CreatePropertyDataAccessor to create your IPropertyDataAccessor. If you're implementing a custom IPropertyDataAccessor, it needs to return both Value and Values for nesting to work. Values by default is an object array containing Value.


Actipro Software Support

Posted 12 years ago by Tim Schattkowsky
Avatar

Thanks!

Returning Values[] did the job.

Posted 5 years ago by Nausheen - AVEVA
Avatar

Hello,

Would you be able to post a sample around this, I am doing something similar to achieve showing nested properties in the Property grid.

Thanks,

Nausheen

The latest build of this product (v24.1.3) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.