如何在propertygrid中加载xml文档 [英] How to load xml document in propertygrid

查看:129
本文介绍了如何在propertygrid中加载xml文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在属性网格中加载XML文档以及如何在属性网格中将XML标签显示为属性
例如)

how to load XML document in property grid and display the XML tags as properties in property grid
ex)

<property>
   <partname name="PartName" value="0090-sw" />
   <noofparts name="NoOfParts" value="5" />
</property>



在属性网格中,我应该将名称="PartName"作为属性,并将值获取为"0090-sw".类似地,"NoOfParts"作为属性,而5作为值


[Edit]代码包装在"pre"标签中[/Edit]



in property grid I should get name ="PartName" as property and value as "0090-sw". similarly "NoOfParts" as property and 5 as value


Code is wrapped in "pre" tag[/Edit]

推荐答案

为您要使用的类编写xmlserializer/deserializer绑定到您的propertygrid.
阅读下一篇文章: http://support.microsoft.com/kb/815813 [
Write an xmlserializer/deserializer for the class you want to bind to your propertygrid.
Read the next article : http://support.microsoft.com/kb/815813[^]

Cheers


CodeProject 中有一些好的控件可能对您有用:
-
XmlGridControl在PropertyGrid中编辑XML数据 [ XmlGrid [
There are good controls in CodeProject that could be useful for you:
- XmlGridControl Editing XML Data in the PropertyGrid[^]
- XmlGrid[^]

:)


这篇关于如何在propertygrid中加载xml文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆