title: WPF: GroupBox dynamic height
body: <p>I have a textbox and datagrid inside of a dockpanel that is in a WPF groupbox.</p>
  
  <pre><code>&lt;GroupBox Margin="8,142.04,1.783,230.4" Height="Auto" Header="Desired Meeting Outcomes (decisions or actions)?" MaxWidth="635" MinWidth="550" FontWeight="Bold" FontSize="13.333" BorderBrush="#FFD5DFE5" MinHeight="106" VerticalContentAlignment="Stretch"&gt;
          &lt;DockPanel Margin="0"&gt;
              &lt;local:TextboxControl Margin="0" d:LayoutOverrides="Height, HorizontalMargin" Width="538.217" VerticalAlignment="Top" HorizontalAlignment="Left" DockPanel.Dock="Top"/&gt;
              &lt;local:  Height="Auto" HorizontalAlignment="Left" MinHeight="25" MinWidth="538" DockPanel.Dock="Top"/&gt;
          &lt;/DockPanel&gt;
      &lt;/GroupBox&gt;
  </code></pre>
  
  <p>I am adding rows in the datagrid dynmaically from the textbox causing the datagrid to grow. However, my groupbox's height is not growing dynamically even though its height is set to Auto. How can I get my groupbox to grow and shrink based upon the size of the contents that it holds?</p>