Reputation: 1304
How to bind below XML to Gridview?
<Students>
<sem id="1">
<student id="101">
<mark total="700"/>
</student>
</sem>
<sem id="2">
<student id="101">
<mark total="800"/>
</student>
</sem>
<sem id="1">
<student id="102">
<mark total="700"/>
</student>
</sem>
<sem id="2">
<student id="102">
<mark total="900"/>
</student>
</sem>
</Students>
I want to display grid as below
student sem1 sem2
101 700 600
102 800 900
I've tried to read xml into dataset and assigned dataset table to grid source.
Upvotes: 0
Views: 110
Reputation: 170
You may use some of the controls from the toolbox :
Upvotes: 0
Reputation: 126
Directly reading the xml file into a dataset may not give you the desired table view. Instead you can use System.Xml namespace and its classes like XmlDocument,XmlElement etc to read the xml and create a datatable and then bind the datasource
Upvotes: 2