绑定 ComboBox
用xml 怎么绑定ComboBox
<NewDataSet>
<Table>
<ID>1</ID>
<Name>欢喜果</Name>
<ParentID>0</ParentID>
<ShowOrder>1</ShowOrder>
<SubCount>4</SubCount>
<SiblingCount>5</SiblingCount>
</Table>
<Table>
<ID>2</ID>
<Name>菩提树</Name>
<ParentID>0</ParentID>
<ShowOrder>2</ShowOrder>
<SubCount>0</SubCount>
<SiblingCount>5</SiblingCount>
</Table>
<Table>
<ID>3</ID>
<Name>生活聊斋</Name>
<ParentID>0</ParentID>
<ShowOrder>3</ShowOrder>
<SubCount>0</SubCount>
<SiblingCount>5</SiblingCount>
</Table>
<Table>
<ID>4</ID>
<Name>读书会</Name>
<ParentID>0</ParentID>
<ShowOrder>4</ShowOrder>
<SubCount>0</SubCount>
<SiblingCount>5</SiblingCount>
</Table>
<Table>
<ID>5</ID>
<Name>科技科幻</Name>
<ParentID>0</ParentID>
<ShowOrder>5</ShowOrder>
<SubCount>0</SubCount>
<SiblingCount>5</SiblingCount>
</Table>
<Table>
<ID>6</ID>
<Name>爆笑网文</Name>
<ParentID>1</ParentID>
<ShowOrder>1</ShowOrder>
<ParentName>欢喜果</ParentName>
<SubCount>0</SubCount>
<SiblingCount>4</SiblingCount>
</Table>
<Table>
<ID>9</ID>
<Name>dfg</Name>
<ParentID>1</ParentID>
<ShowOrder>1</ShowOrder>
<ParentName>欢喜果</ParentName>
<SubCount>0</SubCount>
<SiblingCount>4</SiblingCount>
</Table>
<Table>
<ID>7</ID>
<Name>冷笑话</Name>
<ParentID>1</ParentID>
<ShowOrder>2</ShowOrder>
<ParentName>欢喜果</ParentName>
<SubCount>0</SubCount>
<SiblingCount>4</SiblingCount>
</Table>
<Table>
<ID>8</ID>
<Name>中国</Name>
<ParentID>1</ParentID>
<ShowOrder>3</ShowOrder>
<ParentName>欢喜果</ParentName>
<SubCount>0</SubCount>
<SiblingCount>4</SiblingCount>
</Table>
</NewDataSet>
[解决办法]
通过下面这篇文章的XmlReader方式将Xml转换为实体类,然后将实体类绑定到ComboBox即可。
http://www.cnblogs.com/chengxingliang/archive/2011/02/15/1955589.html