From: Anthony on
How can i parse a hierarchical xml file to a dataGrid (complete xml file).
Adding the attributes from an element works well, but i need to add all
(child) elements and there attributes (from root to end)

<rootelement attribute="" attribute="">

<firstelement attribute="" attribute="">

<secondelement attribute="" attribute="" attribute="">
<thirdelement attribute="">
<fourthelement attribute="" attribute="">
</thirdelement>
<fifthelement attribute="" attribute="">
</secondelement>

<secondelement attribute=" attribute="" attribute="">
<thirdelement attribute="">
<fourthelement attribute="">
<thirdelement>
<fifthelement attribute="" attribute="">
</secondelement>

<firstelement>

</rootelement>

(Windows applicarion)

Anthony


From: Bob on
On Fri, 9 Apr 2010 20:06:51 +0200, "Anthony" <Anthony(a)anti.spam.com>
wrote:

>How can i parse a hierarchical xml file to a dataGrid (complete xml file).
>Adding the attributes from an element works well, but i need to add all
>(child) elements and there attributes (from root to end)
>
><rootelement attribute="" attribute="">
>
> <firstelement attribute="" attribute="">
>
> <secondelement attribute="" attribute="" attribute="">
> <thirdelement attribute="">
> <fourthelement attribute="" attribute="">
> </thirdelement>
> <fifthelement attribute="" attribute="">
> </secondelement>
>
> <secondelement attribute=" attribute="" attribute="">
> <thirdelement attribute="">
> <fourthelement attribute="">
> <thirdelement>
> <fifthelement attribute="" attribute="">
> </secondelement>
>
> <firstelement>
>
></rootelement>

If you're intending to keep some type of hierarchical
structure--indents or even +/- to open/close individual elements--then
you'll have to look into a custom control. Search CodeProject.com for
TreeGridView. There is one project there, with some additional
comments if you search the web. Also there's another control, that's
called something like "Hierarchical DataGridView" or maybe just
DataGrid.

If you only need text in the fields, you could look for
"TreeListView." There are a couple relevant projects on Codeproject
as well.

Please follow up here. I was looking into this recently, but got
sidetracked. I'll be getting back to it soon.



From: Anthony on
Thanks for your advice.
I am going to see if I can find it and whether it works for me.

Anthony