Groups | Blog | Home
all groups > dotnet xml > august 2004 >

dotnet xml : Binding XML to datagrid



Do
8/23/2004 11:37:34 PM
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

jason NO[at]SPAM no-spam.dive-master.org
8/24/2004 7:01:45 AM
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" <doduong12141214@hotmail.com>
[quoted text, click to view]
Do
8/24/2004 7:25:53 AM
Do I have to import a schema and how do I create one on the fly with the
existing doc?

[quoted text, click to view]

jason NO[at]SPAM no-spam.dive-master.org
8/24/2004 2:51:33 PM
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" <doduong12141214@hotmail.com>
[quoted text, click to view]
AddThis Social Bookmark Button