Home All Groups Group Topic Archive Search About

GridView and XML problems

Author
6 Jan 2006 1:08 AM
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.

Author
6 Jan 2006 3:08 PM
Remy
Did you define and load the xsd file beforehand? I do load xml like the
one you posted and it works nicely.
Are all your drivers up to date? click for free checkup

Author
7 Jan 2006 10:10 PM
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


Show quoteHide quote
"Remy" <rblaett***@hotmail.com> wrote in message
news:1136560090.913373.104710@f14g2000cwb.googlegroups.com...
> Did you define and load the xsd file beforehand? I do load xml like the
> one you posted and it works nicely.
>
Author
8 Jan 2006 11:24 AM
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

Bookmark and Share