如何将数据从xml加载到Dropdownlist? [英] how to load data from the xml to Dropdownlist?
问题描述
我有一个xml文件
< 产品 >
< idproduct > 1 < /idproduct >
< 名称 > 牛奶< /name >
< 单位 > 可以< / >
< 成本 > $ 2 < /cost >
< /product >
< 产品 >
< idproduct > 2 < /idproduct >
< 名称 > 橙色< /name >
< 单位 > 桶< /unit >
< 成本 > $ 10 < /cost >
< /product >
...
如何将单元从xml加载到Dropdownlist?
我尝试像Winform C#一样使用Items.Add (node [2]. InnerText)
和SelectedIndexChanged.我得到了Item增加的数量.在Dropdownlist中重复了单元.
2 /cost < /product > < 产品 > < idproduct > 2 < /idproduct > < 名称 > 橙色< /name > < 单位 > 桶< /unit > < 成本 >
10 < /cost > < /product >
...
如何将单元从xml加载到Dropdownlist?
我尝试像winform C#一样使用Items.Add (node [2]. InnerText)
和SelectedIndexChanged.我得到了Item增加的数量.在Dropdownlist中重复了单元.
检查这些博客
http://geekswithblogs.net/AzamSharp/archive/2005/08/18/50567.aspx [ ^ ]
http://www.youtube.com/watch?v=lLlFOS5LA08 [<product> <idproduct>1</idproduct> <name>milk</name> <unit>can</ unit> <cost>$2</cost> </product> <product> <idproduct>2</idproduct> <name>oranges</name> <unit>barrel</unit> <cost>$10</cost> </product>
...
how to load unit from the xml to Dropdownlist?
I tried usingItems.Add (node [2]. InnerText)
and SelectedIndexChanged like winform C #.I get number of Item increase.Unit repeat in Dropdownlist.解决方案2</cost> </product> <product> <idproduct>2</idproduct> <name>oranges</name> <unit>barrel</unit> <cost>
10</cost> </product>
...
how to load unit from the xml to Dropdownlist?
I tried usingItems.Add (node [2]. InnerText)
and SelectedIndexChanged like winform C #.I get number of Item increase.Unit repeat in Dropdownlist.
check these blogs
http://geekswithblogs.net/AzamSharp/archive/2005/08/18/50567.aspx[^]
http://www.youtube.com/watch?v=lLlFOS5LA08[^]
--NDK
这篇关于如何将数据从xml加载到Dropdownlist?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!