title: Hide and auto resize columns with GridSplitter
body: <p>I've a project with 1 header row and 1 content row. The content row is divided into 3 columns (groupboxes). These 3 columns are realized with GridSplitter.</p>
  
  <p><strong>Source Code:</strong></p>
  
  <hr>
  
  <pre><code>&lt;Window 
          x:Class="Test.MainWindow"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:ViewMenu="clr-namespace:Cons.ViewMenu"
          Title="Test Gridsplitter"
          Height="700"
          Width="1000"&gt;
  
      &lt;Window.Resources&gt;
          &lt;BooleanToVisibilityConverter x:Key="BoolToVisConverter" /&gt;
      &lt;/Window.Resources&gt;
  
      &lt;Grid&gt;
          &lt;Grid.RowDefinitions&gt;
              &lt;RowDefinition Height="50" /&gt;
              &lt;RowDefinition Height="*" /&gt;
          &lt;/Grid.RowDefinitions&gt;
  
          &lt;!-- Row 0 --&gt;
          &lt;GroupBox Name="Menu" Grid.Row="0"&gt;
  
              &lt;ViewMenu:LockedToolBar&gt;
                  &lt;ToggleButton x:Name="HideColumn0Button" IsChecked="True" Width="80" Height="40"&gt;Hide C0&lt;/ToggleButton&gt;
  
                  &lt;ToggleButton x:Name="HideColumn1Button" IsChecked="True" Width="80" Height="40"&gt;Hide C1&lt;/ToggleButton&gt;
  
                  &lt;ToggleButton x:Name="HideColumn2Button" IsChecked="True" Width="80" Height="40"&gt;Hide C2&lt;/ToggleButton&gt;
              &lt;/ViewMenu:LockedToolBar&gt;
  
          &lt;/GroupBox&gt;
  
          &lt;!-- Row 1 --&gt;
          &lt;GroupBox Name="Body" Grid.Row="1"&gt;
              &lt;Grid&gt;
                  &lt;Grid.ColumnDefinitions&gt;
                      &lt;ColumnDefinition Width="*" MinWidth="80" /&gt;
                      &lt;ColumnDefinition Width="auto"/&gt;
                      &lt;ColumnDefinition Width="*" MinWidth="80" /&gt;
                      &lt;ColumnDefinition Width="auto"/&gt;
                      &lt;ColumnDefinition Width="*" MinWidth="80" /&gt;
                  &lt;/Grid.ColumnDefinitions&gt;
  
                  &lt;!-- Column 0 --&gt;
                  &lt;GroupBox Header="Column 0" 
                            Name="ds"
                            Grid.Row="0" 
                            Grid.Column="0" 
                            Visibility="{Binding Path=IsChecked, ElementName=HideColumn0Button, Converter={StaticResource BoolToVisConverter}}"&gt;
                      &lt;Grid&gt;
                          &lt;Grid.RowDefinitions&gt;
                              &lt;RowDefinition Height="40" /&gt;
                              &lt;RowDefinition Height="*" /&gt;
                          &lt;/Grid.RowDefinitions&gt;
  
                          &lt;ViewMenu:LockedToolBar Grid.Row="0"&gt;
                          &lt;/ViewMenu:LockedToolBar&gt;
                      &lt;/Grid&gt;
                  &lt;/GroupBox&gt;
  
                  &lt;!-- Column 1 --&gt;
                  &lt;GroupBox Header="Column 1" 
                            Grid.Row="0" 
                            Grid.Column="2"
                            Visibility="{Binding Path=IsChecked, ElementName=HideColumn1Button, Converter={StaticResource BoolToVisConverter}}"&gt;
                      &lt;Grid&gt;
                          &lt;Grid.RowDefinitions&gt;
                              &lt;RowDefinition Height="40" /&gt;
                              &lt;RowDefinition Height="*" /&gt;
                          &lt;/Grid.RowDefinitions&gt;
  
                          &lt;ViewMenu:LockedToolBar Grid.Row="0"&gt;
                          &lt;/ViewMenu:LockedToolBar&gt;
                      &lt;/Grid&gt;
                  &lt;/GroupBox&gt;
  
                  &lt;!-- Column 2 --&gt;
                  &lt;GroupBox Header="Column 2" 
                            Grid.Row="0" 
                            Grid.Column="4"
                            Visibility="{Binding Path=IsChecked, ElementName=HideColumn2Button, Converter={StaticResource BoolToVisConverter}}"&gt;
                      &lt;Grid&gt;
                          &lt;Grid.RowDefinitions&gt;
                              &lt;RowDefinition Height="40" /&gt;
                              &lt;RowDefinition Height="*" /&gt;
                          &lt;/Grid.RowDefinitions&gt;
  
                          &lt;ViewMenu:LockedToolBar Grid.Row="0"&gt;
                          &lt;/ViewMenu:LockedToolBar&gt;
                      &lt;/Grid&gt;
                  &lt;/GroupBox&gt;
  
                  &lt;GridSplitter Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="5"/&gt;
                  &lt;GridSplitter Grid.Column="3" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="5"/&gt;
              &lt;/Grid&gt;
          &lt;/GroupBox&gt;
  
      &lt;/Grid&gt;
  
  &lt;/Window&gt;
  </code></pre>
  
  <hr>
  
  <p>I click on HideColumn1Button, column 1 is hidden, but the other two columns have the same width as before. But I want, that column 0 and 2 are auto resized to the complete width.</p>
  
  <p>Does anyone of you know, how to do that?</p>