Click here to Skip to main content
15,881,812 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all,

iam working the silverlight,

i am store the student details in isolatedstoragefile and read the isolatedstoragefile to assign the datagrid itemssource.

i did complete the store and retrive the values from isolatedstoragefile

lastly iam getting the value

string result=
XML
<?xml version="1.0" encoding="utf-8"?>
<Data xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <StudentName>Raju</StudentName>
  <RegNo>54</RegNo>
  <Marks1>65</Marks1>
  <Marks2>87</Marks2>
  <Marks3>88</Marks3>
  <Marks4>97</Marks4>
</Data>

like this now i don't know how can i read the student details from this string and assign the datagrid.itemssource=result.

let me know how to read to bind the itemssource

thanks and regards.........
Posted
Updated 26-Jul-12 19:42pm
v2

Check this article.

XML to DataSet or GridView and back[^]
 
Share this answer
 
Comments
U@007 27-Jul-12 1:41am    
in silverlight is ther XMLDocument Class?
Santhosh Kumar Jayaraman 27-Jul-12 1:45am    
Check this, how to use XDocument instead of xmldocument in silverlight

http://forums.silverlight.net/t/11702.aspx[^]
Santhosh Kumar Jayaraman 27-Jul-12 1:49am    
also check this.
http://stackoverflow.com/questions/9548368/how-to-create-an-xml-document-in-silverlight
U@007 27-Jul-12 2:03am    
Thank you santhos

in my side 5!
finally i did this after googling

C#
XDocument xmlProducts = XDocument.Parse(results);
                    var student = from stu in xmlProducts.Descendants("Students")
                                  select new Students
                                  {
                                      StudentName = stu.Element("StudentName").Value,
                                      RegNo = Convert.ToInt32(stu.Element("RegNo").Value),
                                      Marks1 = Convert.ToInt32(stu.Element("Marks1").Value),
                                      Marks2 = Convert.ToInt32(stu.Element("Marks1").Value),
                                      Marks3 = Convert.ToInt32(stu.Element("Marks1").Value),
                                      Marks4 = Convert.ToInt32(stu.Element("Marks1").Value)
                                  };
                    dataGrid4.ItemsSource = student;
 
Share this answer
 
Comments
Prasad_Kulkarni 27-Jul-12 2:04am    
5'ed, for posting answer. Good work!
U@007 27-Jul-12 2:07am    
Thank you Prasad_Kulkarni :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900