WPF 数据绑定TreeView+DataGrid+XML
学习WPF做的一个数据绑定例子,可供学习参考。 实现功能:WPF通过读取XML数据绑定到TreeView, 在通过TreeView选择项(Node)获取的对应的数据绑定到DataGrid控件上,再通过DataGrid选中行的详细信息数据绑定到DataGrid。 首先创建XML数据 <?xml version="1.0" encoding="utf-8" ?> <root> <category name="Computer"> <product name="联想笔记本"> <order orderId="1" orderName="cizon的订单" orderDate="2012-11-10"> <orderInfo productName="联想笔记本" unitPrice="3000" count="2"> </orderInfo> </order> <order orderId="2" orderName="steven的订单" orderDate="2012-11-10"> <orderInfo productName="联想笔记本" unitPrice="3000" count="2"> </orderInfo> </order> </product> <product name="宏基笔记本"> <order orderId="1" orderName="Luly的订单