title: TableLayoutPanel remove empty rows
body: <p>I'm trying to remove all empty rows from a <code>TableLayoutPanel</code>. So far I have been able to do it this way</p>
  
  <pre><code>private void RemoveEmptyRows()
  {
      for (int row = 0; row &lt; tablePanel.RowCount - 1; row++)
      {
          bool hasControl = false;
          for (int col = 0; col &lt; tablePanel.ColumnCount; col++)
          {
              if (tablePanel.GetControlFromPosition(col, row) != null)
              {
                  hasControl = true;
                  break;
              }
          }
          if (!hasControl)
              tablePanel.RowStyles.RemoveAt(row);
      }
  }
  </code></pre>
  
  <p>Is there a better way of this? My approach seems too overwhelmed.</p>