Databinding to Xml Document

Grids for WPF Forum

Posted 14 years ago by chris

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 14 years ago by Actipro Software Support - Cleveland, OH, USA
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 12 years ago by Juergen Kayser - Germany


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 12 years ago]

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

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 (v24.1.2) was released 26 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.