title: Hide grid row in WPF
body: <p>I have a simple WPF form with a <code>Grid</code> declared on the form. This <code>Grid</code> has a bunch of rows:</p>
  
  <pre><code>&lt;Grid.RowDefinitions&gt;
      &lt;RowDefinition Height="Auto" MinHeight="30" /&gt;
      &lt;RowDefinition Height="Auto" Name="rowToHide" /&gt;
      &lt;RowDefinition Height="Auto" MinHeight="30" /&gt;
  &lt;/Grid.RowDefinitions&gt;
  </code></pre>
  
  <p>The row named <code>rowToHide</code> contains a few input fields and I want to hide this row after I detect I don't need these fields. It's simple enough to just set <code>Visibility = Hidden</code> to all items in the row, but the row still takes up space in the <code>Grid</code>. I tried setting <code>Height = 0</code> to the items, but that didn't seem to work.</p>
  
  <p>You can think of it like this: You have a form, in there you have a drop down saying "Payment Type", and if the person selects "Cash", you want to hide the row containing the Card details. It isn't an option to start the form with this hidden already.</p>