I want to bind raw xml file to datagrid and to display that on WPF form using C#. I planed to use dataset to store my xml, and then bind dataset to datagrid. My xml look 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 columns id, name, movesLeft, won, completed tied to element
Best place to start would be with the XmlTextReader class (System.Xml)
Best resource I found for this is straight from MS XmlTextReader Link
It lets you read the xml file and parse through it by element type/name/etc.
Hope this helps.
From there, you can parse those to DataTables as normal and then bind them to the grid, also as normal. If you need info on that too, let me know