Hi Friends,
i m trying to display xml data in to datagid with specific columns .
i am using windows mobile devise application.
i have one xml file in that file have 3 clumns R_ID,R_NAME,R_PROP. i binded in datagrid its ok. here i have smale problem .when i bind datagrid its display all columns.
i want display only specific columns in datagrid like R_NAME,R_PROP only.
any one have idea please share how to display.
Thanks
Venkat.S
How to display xml data in to datagrid and how to display only specific columns
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.


Dorababu MekaRank #457 · 5.5K reputationPosted Jun 15, 2011, 6:13 AM EDT
Dataset ds=new dataset();
ds.ReadXML("Your.xml",xmlreadmode.inferschema);
datagrid.setdatabinding(ds,"Table");
or
XmlReader xmlFile ;
xmlFile = XmlReader.Create("Your.xml", new XmlReaderSettings());
ds = new DataSet();
ds.ReadXml(xmlFile);
dataGridView1.DataSource = ds.Tables[0];