Display XML in Datagrid or table

C

csgraham74

Hi guys,

just wondering if someone could help me a little.

i have a piece of xml being returned to my page. This xml can vary
depending on criteria that i select and submit.

my issue is that when the data is returned i wish to display the result
in a table. Im not sure what the best way is to do this. should this be
done in a datagrid that i create dynamically or can i draw an html
table and place the results in the cell by looping the xml.

any help and examples greatly appreciated !!!

Thanks in advance.

CG
 
G

Guest

Hi CG,

To use datagrid is easier. You can try following code snippet:

DataSet ds = new DataSet();
ds.ReadXml(xmlFile);
DataGrid dg = new DataGrid();
dg.DataSource = ds;
dg.DataBind();
this.Controls.Add(dg);


HTH

Elton Wang
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,832
Latest member
GlennSmall

Latest Threads

Top