Binding source XML with datagrid in WPF

I want to link a raw xml file to a datagrid and display it in WPF form using C #. I planned to use a dataset to store my xml, and then bind the dataset to a datagrid. My xml looks something like this.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<games>
  <game id="123456" name="501">
    <player id="1">
      <name>john</name>
      <score>495</score>
      <movesLeft>15</movesLeft>
      <won>No</won>
      <completed>uncompleted</completed>
    </player>
    <player id="2">
      <name>
         konj
      </name>
      <score>501</score>
      <movesLeft>15</movesLeft>
      <won>No</won>
      <completed>uncompleted</completed>
    </player>
  </game>
</games>

I plan to use two datagrids one for and one for with column identifiers, name, moveLeft, won, completed bound to an element

+3
source share
1 answer

A better place to start would be with the XmlTextReader class (System.Xml)

, , MS XmlTextReader Link XML / ..

, .

DataTables , , . ,

+1

Source: https://habr.com/ru/post/1779212/


All Articles