Creating nested property items

Grids for WPF Forum

Posted 7 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 (2)

Answer - Posted 7 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 7 years ago by Tim Schattkowsky
Avatar

Thanks!

Returning Values[] did the job.

The latest build of this product (v2019.1 build 0683) 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.