title: c# filter xml file by attribute and show in datagridview
body: <p>I have looked and can't find the answer, I'm sure I'm just not looking for the right keywords, lol.</p>
  
  <p>I have an XML file that I display in a datagridview, this all works fine. I'm trying to implant where I can click a button and 'reload' the datagridview with only certain parts of the xml file.</p>
  
  <p>I will describe better. Just bear with me, I'm not the best at explaining.</p>
  
  <p>This is the layout of my xml file.</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;Movies&gt;
    &lt;Name Name="Saw" Type="Horror" Year="2004-10-29" Overview="Overview"&gt;Saw&lt;/Name&gt;
    &lt;Name Name="Saw II" Type="Horror" Year="2005-10-28" Overview="Overview"&gt;Saw II&lt;/Name&gt;
    &lt;Name Name="Speed" Type="Action" Year="1994-06-10" Overview="Overview"&gt;Speed&lt;/Name&gt;
    &lt;Name Name="Batman Begins" Type="Action" Year="2005-06-17" Overview="Overview"&gt;Batman Begins&lt;/Name&gt;
  &lt;/Movies&gt;
  </code></pre>
  
  <p>When I display normally I have it in a grid view like so.
  I had to upload image elsewhere the site wouldn't let me put it here.
  <a href="http://screensnapr.com/e/ziyVvn.png" rel="nofollow">enter link description here</a></p>
  
  <p>Now what I'm trying to do is make is where when I click a button I can display only certain Movie Types. Say for example, click a button and only display movies that are "Action".</p>
  
  <p>I have found information on this and got where I can select only the actions. I got them to pop up in messageboxs'</p>
  
  <pre><code>                XmlDocument xml = new XmlDocument();
              xml.Load("movie.xml");
  
              XmlNodeList xnList = xml.SelectNodes("/Movies/Name[@Type='Action']");
              foreach (XmlNode xn in xnList)
              {
                  MessageBox.Show(xn.InnerText);
              }
  </code></pre>
  
  <p>This actually shows say from the image the 2 movies that are action. But I can't figure out how to reload the datagridview with only these entries, and prefer with all information as before.</p>
  
  <p>If I didn't explain clearly please say so, as I said before I know I"m not the best at explaining things.</p>