473,226 Members | 1,307 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,226 software developers and data experts.

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 10204
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ann Morris | last post by:
INTRODUCTION One of the most powerful aspects of .NET and Windows Forms is data binding. Data binding is the process of associating user interface (UI) elements with a data source to generate a...
1
by: Mike Dole | last post by:
Why is it that when I want to use an attribute like for instance: .WriteAttributeString("WaiterId", "14") and later on (in another application) want to bind the xml to a datagrid with readxml I'm...
0
by: Shane O. Pinnell | last post by:
I am sure this has come up before, but I haven't been able to find an answer as of yet. That said, any help is definitely appreciated! I have a datagrid populated from a dataset. I have a...
3
by: Jim Bancroft | last post by:
Hi everyone, I'm binding an ArrayList to a DataGrid for the first time (I'm used to binding DataSets and DataTables) and I was wondering if I could somehow "name" the ArrayList, so that I can...
8
by: Richard L Rosenheim | last post by:
I have a dataset containing a parent table related to a child table. The child table contains an ID field (which is configured as autonumber in the datatable), the ID of the parent, plus some...
5
by: Brad Shook | last post by:
I am trying to bind one column of a datagrid to a seperate textbox and the rest of the fields to a datagrid. the comments are too large to fit in a datagrid so I created a textbox below the...
2
by: yuanh23 | last post by:
Hi, I have 3 talbes "customers","orders","details". i wanna to use 3 datagrids to show those tables. and when the selected row in parent talbe changes, the selected row in child table changes...
6
by: p.mc | last post by:
Hi all, I'm having major problems with a userControl which contains a datagrid. My problem concerns data binding. The Page_Load() procedure calls the DataBind procedure to bind the datagrid...
3
by: no | last post by:
Hi all, I have a dataset that contain 2 tables and a relationship between them (master detail). I bind this dataset to a form that include some textboxes that bind to the parent record, and a...
1
by: Stephen Barrett | last post by:
I have an application that was originally built with ASP.Net 1.1. We finally got permission to migrate to 2.0. Due to time constraints we migrated the web projects to 2.0 web application...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.