简体   繁体   English

使用C#使用所选xml节点的属性填充组合框

[英]populate a combobox with attributes of a selected xml node using c#

Im using c#.net windows form application. 我正在使用c#.net Windows窗体应用程序。 I have a xml file. 我有一个xml文件。 I have loaded the node names of that xml file into a treeview. 我已经将该XML文件的节点名称加载到树视图中。 Now my task is , when I select a particular node from the treview, I should be able to display its attributes in a combo box. 现在我的任务就是,当我选择从一个t检讨特定节点,我应该能够在组合框显示其属性。 Please help. 请帮忙。

When populating each XML node in the treeview, store the actual XPATH as a tag of that treeview node. 当填充树视图中的每个XML节点,存储实际XPATH为树状节点的标签。 On click, pick up the tag value, query the XmlDocument object and display your attributes. 单击后,拾取标记值,查询XmlDocument对象并显示您的属性。

Or maybe saeed is lazy to create it by himself. 或者,也许是赛义德通过懒惰自己去创造。

@Raj - you don't have to store XPATH as a tag, you can store the node itself there. @Raj-您不必将XPATH存储为标记,可以将节点本身存储在其中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM