title: How can I loop through the rows of a Grid in a TabControl (vb.net)?
body: <p>I have a tab control that has a number of tabs and each tab page has a grid added to it. When I click on Save As button I want the program to loop through the grids on each tab and save the data in an XML-like format. </p>
  
  <p>The file should look something like this:</p>
  
  <pre><code>&lt;GridTabPage1&gt;
  &lt;Row1&gt; A, B, C ... &lt;/Row1&gt;
  &lt;/GridTabPage1&gt;
  </code></pre>
  
  <p>What I am currently trying but it is not working is:</p>
  
  <pre><code>For Each row As DataGridView In TabControl.SelectedTab.Controls(Grid.Rows)
  ...
  Next
  </code></pre>
  
  <p>Could anyone please point me in the right direction?</p>
  
  <p>I hope my explanation of the problem was not confusing. Let me know if you need clarification.</p>
  
  <p>Thanks guys</p>