WPF Datagrid binding to xml

前端 未结 2 1309
梦谈多话
梦谈多话 2021-01-17 04:51

I want to programmatically bind an XML file containing some results pulled out from database to my Datagrid. My XML looks like:

         


        
2条回答
  •  既然无缘
    2021-01-17 05:17

    I suppose you already have xmldataprovider with your Xml source named myXMLDoc. then you can bind xml data to your WPF controls.

    ItemsSource="{Binding Source={StaticResource myXMLDoc}, XPath=row}}" //bind "row" elements to your control
    

提交回复
热议问题