Databinding to Xml Document

Grids for WPF Forum

Posted 10 years ago by chris
Avatar
Hi,

Do you have any sample projects about how to databind PropertyGrid to Xml document?
I have some data in XmlDocument and want to populate them in PropertyGrid.

Thanks a lot!

Comments (3)

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Chris,

We don't currently have an example of binding to an XML document, but it is on our TODO list. The Custom Factory (Dictionary) QuickStart does show how a custom factory and accessors can be used though. That could be adapted to generate accessors for an XML document.

The basic idea is that the DataFactory.GetProperties(object, DataFactoryOptions) would be passed the SelectedObject(s), which in your case would be an XmlDocument. GetProperties would then return 0 or more IPropertyDataAccessor objects, which are presented by the PropertyGrid.

DataFactory.GetProperties will also get called for sub-properties (or elements), so you'd need to handle that case also (such as returning accessors for inner elements).

Hope this helps.


Actipro Software Support

Posted 8 years ago by Juergen Kayser - Germany
Avatar

Hi,

the comment above was posted two years ago.

Is there an example of binding a property grid to an XML document in the latest build (2011.2 build 0553) now?

Thank you!

[Modified 8 years ago]

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

Hi Juergen,

Unfortunately, no we do not have such a sample at this time. The approach above still applies though.


Actipro Software Support

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.