Note that there are some explanatory texts on larger screens.

plurals
  1. PODisplay hierarchical XML data using DataGrid
    primarykey
    data
    text
    <p>I have an XML file such as the one shown below</p> <pre><code>&lt;root&gt; &lt;child1&gt; &lt;grandchild1&gt; &lt;greatgrandchild1&gt; &lt;/greatgrandchild1&gt; &lt;greatgrandchild2&gt; &lt;/greatgrandchild2&gt; ... &lt;/grandchild1&gt; &lt;grandchild2&gt; &lt;/grandchild2&gt; &lt;grandchild3&gt; &lt;/grandchild3&gt; ... &lt;/child1&gt; &lt;child2&gt; &lt;grandchild1&gt; &lt;/grandchild1&gt; &lt;grandchild2&gt; &lt;/grandchild2&gt; &lt;grandchild3&gt; &lt;/grandchild3&gt; ... &lt;/child2&gt; &lt;child3&gt; &lt;grandchild1&gt; &lt;/grandchild1&gt; &lt;grandchild2&gt; &lt;/grandchild2&gt; &lt;grandchild3&gt; &lt;/grandchild3&gt; ... &lt;/child3&gt; ... &lt;/root&gt; </code></pre> <p>Each child node has a different name. I need to display this XML in the following manner:</p> <p>Each child node is displayed as an <code>Expander</code>. All the grandchildren of that child node is placed inside that expander. Each grandchild and its children should be grouped and should have a background color. The next grandchild and its children should have an alternate color background.</p> <p>The whole data has two columns. So the control that is chosen to display this data should be able to support multiple columns. </p> <p>I was thinking of a <code>DataGrid</code>. But I cannot use its built in features as I cannot do data binding. I need to programmatically add the items to the <code>DataGrid</code>. Please let me know how can I solve this problem. Any help is greatly appreciated. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload