title: how to load a datagridview with my data from xml
body: <p>I have this XML:</p>
  
  <pre><code>&lt;container_1 attr1="..." attr2="..." attr3="..."&gt;
    &lt;rekord_1&gt;
      &lt;type_1 attr1="..." attr2="..." ... /&gt;
      &lt;type_2 attr1="..." attr2="..." ... /&gt; 
    &lt;/rekord_1&gt;
    &lt;rekord_2&gt;... &lt;/rekord_2&gt;
    .
    .
    &lt;rekord_N&gt; ... &lt;/rekord_N&gt;
  &lt;/container_1&gt;
  </code></pre>
  
  <p>I can parse the way I want and show it in a console app (using <code>XMLElements</code>, <code>XMLNodeLists</code> and a few loops) but I want to make an app with GUI and table view.
  My form app could read the XML, but it can only handle 1 tag right now.  For example, if I get the <code>container_1</code> tag, it outputs only <code>container_1</code>'s attributes by itself, but I want to show the records under the <code>container_1</code> in table view also.</p>
  
  <p>I want to make it view-able like my older program in console.</p>
  
  <p>How can I get out the data from my XML so that I will be able to work with the elements/attributes? Because I want to set their place in the table view.
  Which documentation should I read? Or is there some example which could be useful to me?</p>
  
  <p>Edited(aug. 20):
  Here is the main part of the code:</p>
  
  <pre><code>private void button1_Click(object sender, EventArgs e)
      {
          Stream input=null;
          OpenFileDialog dialog = new OpenFileDialog();
          openFileDialog1.InitialDirectory = "C:/";
          openFileDialog1.Filter = "xml file | *.xml";
          openFileDialog1.FilterIndex = 2;
          openFileDialog1.RestoreDirectory = true;
  
          if (openFileDialog1.ShowDialog() == DialogResult.OK) {
              try
              {
                  if ((input = openFileDialog1.OpenFile()) != null)
                  {
                      using (input)
                      {
                          XmlReader xmlFile = XmlReader.Create(input, new XmlReaderSettings());
                          DataSet dataSet = new DataSet();
                          dataSet.ReadXml(xmlFile);
                          DataSet containers = new DataSet();
                          dataGridView1.DataSource = dataSet.Tables[tag];
                          xmlFile.Close();
                      }
                  }
              }
              catch (Exception ex) {
                  MessageBox.Show("ERROR");
              }
          }
      }
  </code></pre>
  
  <p>This function does well the display if my tag is container or rekord and makes this output:
  <a href="http://imgur.com/YEXbV9Z,llZ3QPf#0" rel="nofollow">outputs</a></p>
  
  <p>But I can't display container1+ its rekords,container2+its rekords and so on,only all the containers or all the rekords in same time.</p>