473,480 Members | 1,498 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Display XML in Datagrid or table

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

Nov 19 '05 #1
2 1443
bind the XML datasource to a DataSet, then bind the dataset to a datagrid.

<cs********@hotmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
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

Nov 19 '05 #2
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
el********@hotmail.com
"cs********@hotmail.com" wrote:
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

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2374
by: kll | last post by:
I have been on newsgroup for week. I have seen anything that will help me. Basically, I have a form with a datagrid that can be sorted or unsorted (it is up to the user). Then, I display the data...
18
3321
by: Alpha | last post by:
Hi, I'm working on a Windows applicaton with VS 2003 on windows 2000. I have a listbox that I have binded to a dataset table, "source" which has 3 columns. I would like to display 2 of those...
2
1206
by: Stephen | last post by:
Hi, Can a datagrid display be split into 2 rows. for e.g: suppose my resultset has 20 columns and I want to display 10 in the first row and and rest in another so that the display is not kludgy....
3
1923
by: JJ | last post by:
I have a datagrid on my form that displays its data from various tables within a specified dataset. That all works correclty. However, when one cell is selected prior to changed the displayed...
0
796
by: G .Net | last post by:
Hi I have a question regarding displaying a foreign key in a DataGrid. To explain my question, consider the following: Suppose I have two tables A and B. Table A has the following structure: ...
2
2164
by: hazz | last post by:
With this code, the config file(listed below) opens initially into the datagrid display with only a plus sign '+'. On clicking that, it becomes expanded to; - appsettings add When I click on...
2
2204
by: Cindy | last post by:
Hello. For some reason, I am able to "connect" to the Northwind database whenever I use the wizard; however, when I run the application, my datagrid does not display. Here are the exact steps I...
2
3123
by: harry | last post by:
Hi all, I have a datagrid (language C#) populated using a stored procedure. I want one of the column to display complete name instead of abbreviation. Can I change the display dynamically in the...
2
173
by: Iain Wilson | last post by:
Hi Can anyone please advise if this is possible and if so how I would go about it (a pointer to an example would be greatly appreciated). Using C# - Web Application I have a DropDownList with...
0
7044
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6908
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7087
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6741
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5341
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4782
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
2985
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
563
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
182
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.