469,290 Members | 1,882 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,290 developers. It's quick & easy.

Binding XML to datagrid

Do
Hi,

I tried to bind an XML similar to the following to a datagrid.

<Idontwant>
<Iwant>
<Yes></Yes>
<Yes></Yes>
<Yes></Yes>
<Yes></Yes>
<Yes></Yes>
</Iwant>
</Idontwant>

The datagrid comes up with nothing. When I remove the node 'Idontwant' and
have the
'Iwant' and the root node, everything shows up correctly in the datagrid.
But removing the
'Idontwant' node is not an option of mine.

I want to be selective on the level or group of nodes that I bind to the
datagrid, so I can just
choose everything in //Idontwant/Iwant. How do choose just a portion of the
XML structure?

Code examples and links would be awesome!

Thanks,

Do
Nov 12 '05 #1
4 10085
Is the IWant a related record? Have you imported the schema to
ensure that the relationships are created? Do you have the

DataGrid1.allowNavigation = true

option set so that you can parse through the related tables?

This might not be the problem but it is worth taking a look at.

Jason.

On Mon, 23 Aug 2004 23:37:34 -0700, "Do" <do*************@hotmail.com>
wrote:
Hi,

I tried to bind an XML similar to the following to a datagrid.

<Idontwant>
<Iwant>
<Yes></Yes>
<Yes></Yes>
<Yes></Yes>
<Yes></Yes>
<Yes></Yes>
</Iwant>
</Idontwant>

The datagrid comes up with nothing. When I remove the node 'Idontwant' and
have the
'Iwant' and the root node, everything shows up correctly in the datagrid.
But removing the
'Idontwant' node is not an option of mine.

I want to be selective on the level or group of nodes that I bind to the
datagrid, so I can just
choose everything in //Idontwant/Iwant. How do choose just a portion of the
XML structure?

Code examples and links would be awesome!

Thanks,

Do


Nov 12 '05 #2
Do
Do I have to import a schema and how do I create one on the fly with the
existing doc?

"Jason L James" <ja***@no-spam.dive-master.org> wrote in message
news:41**************@news.demon.co.uk...
Is the IWant a related record? Have you imported the schema to
ensure that the relationships are created? Do you have the

DataGrid1.allowNavigation = true

option set so that you can parse through the related tables?

This might not be the problem but it is worth taking a look at.

Jason.

On Mon, 23 Aug 2004 23:37:34 -0700, "Do" <do*************@hotmail.com>
wrote:
Hi,

I tried to bind an XML similar to the following to a datagrid.

<Idontwant>
<Iwant>
<Yes></Yes>
<Yes></Yes>
<Yes></Yes>
<Yes></Yes>
<Yes></Yes>
</Iwant>
</Idontwant>

The datagrid comes up with nothing. When I remove the node 'Idontwant' andhave the
'Iwant' and the root node, everything shows up correctly in the datagrid.
But removing the
'Idontwant' node is not an option of mine.

I want to be selective on the level or group of nodes that I bind to the
datagrid, so I can just
choose everything in //Idontwant/Iwant. How do choose just a portion of theXML structure?

Code examples and links would be awesome!

Thanks,

Do

Nov 12 '05 #3
You can infer the schema from the XML file.

dim myDS as new DataSet
myDS.ReadXml("C:\myXML.xml", XmlReadMode.InferSchema)
Jason.
On Tue, 24 Aug 2004 07:25:53 -0700, "Do" <do*************@hotmail.com>
wrote:
Do I have to import a schema and how do I create one on the fly with the
existing doc?

"Jason L James" <ja***@no-spam.dive-master.org> wrote in message
news:41**************@news.demon.co.uk...
Is the IWant a related record? Have you imported the schema to
ensure that the relationships are created? Do you have the

DataGrid1.allowNavigation = true

option set so that you can parse through the related tables?

This might not be the problem but it is worth taking a look at.

Jason.

On Mon, 23 Aug 2004 23:37:34 -0700, "Do" <do*************@hotmail.com>
wrote:
>Hi,
>
> I tried to bind an XML similar to the following to a datagrid.
>
><Idontwant>
> <Iwant>
> <Yes></Yes>
> <Yes></Yes>
> <Yes></Yes>
> <Yes></Yes>
> <Yes></Yes>
> </Iwant>
></Idontwant>
>
>The datagrid comes up with nothing. When I remove the node 'Idontwant'and >have the
>'Iwant' and the root node, everything shows up correctly in the datagrid.
>But removing the
>'Idontwant' node is not an option of mine.
>
>I want to be selective on the level or group of nodes that I bind to the
>datagrid, so I can just
>choose everything in //Idontwant/Iwant. How do choose just a portion ofthe >XML structure?
>
>Code examples and links would be awesome!
>
>Thanks,
>
>Do
>
>



Nov 12 '05 #4
Great tutorial.

There is also a tutorial about binding xml to datagrid at www.KYNOU.com
Go to the link above and search for "Binding XML to DataGrid". There is also a chat room where I try to be there to answer questions.
:)
Jun 12 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Mike Dole | last post: by
5 posts views Thread by Brad Shook | last post: by
6 posts views Thread by p.mc | last post: by
3 posts views Thread by no | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.