GridView and XML problems

M

Michael

Hi,

I'm having difficulty displaying some XML data in a GridView. My XML is
something like:
<root>
<Person>
<FirstName>Whatever1</FirstName>
<LastName>Whatever1</LastName>
</Person>
<Person>
<FirstName>Whatever2</FirstName>
<LastName>Whatever2</LastName>
</Person>
</root>

I only managed to display XML data using the XmlDataSource when the data is
in XML attributes instead of XML elements. Something like
<root>
<Person FirstName="Whatever" LastName="Whatever"/>
</root>

Some help will be appreciated.

Thanks.
 
R

Remy

Did you define and load the xsd file beforehand? I do load xml like the
one you posted and it works nicely.
 
M

Michael

Hi Remy,

No I don't have an xsd file. Can you give me a few short code samples of how
you load/link the xsd, and how the xsd helps?

Thanks,
Michael
 
R

Remy

As I don't see your code I cannot promise that the xsd will help, but
it's worth a try and you can definitely use xml the way you used it to
load a datagrid.
here is a good article on the whole subject:
http://www.codeproject.com/aspnet/xmldatagrid.asp

he unfortunately also uses attributes, but just use the example as a
starting point and then convert it to your xml style.

Cheers

Remy
 

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

Top