Display XML in Datagrid or table

  • Thread starter Thread starter csgraham74
  • Start date Start date
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
 
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

Similar Threads

XML, DataSet, DataGrid 3
Remapping xml files in the urlmapping webconfig 1
Return XML in function 1
Display XML file 3
XML Feed Dotnet 4
Displaying XML 1
Form to edit XML records 5
XML challenge! 3

Back
Top