title: WPF Using GridSplitter for individual Row Column in Grid
body: <p>I want to have GridSplitter that resizes only one cell (actually not correct term per se for WPF Grid, let's call it individual Grid[r][c]) and cell adjacent to it to be resized.</p>
  
  <p>Here what I tried:</p>
  
  <pre><code>&lt;Grid&gt;
          &lt;Grid.RowDefinitions&gt;
              &lt;RowDefinition&gt;&lt;/RowDefinition&gt;
              &lt;RowDefinition&gt;&lt;/RowDefinition&gt;
              &lt;RowDefinition&gt;&lt;/RowDefinition&gt;
          &lt;/Grid.RowDefinitions&gt;
          &lt;Grid.ColumnDefinitions&gt;
              &lt;ColumnDefinition&gt;&lt;/ColumnDefinition&gt;
  
              &lt;ColumnDefinition&gt;&lt;/ColumnDefinition&gt;
  
              &lt;ColumnDefinition&gt;&lt;/ColumnDefinition&gt;
          &lt;/Grid.ColumnDefinitions&gt;
          &lt;Border Grid.IsSharedSizeScope="True"  Margin="2" VerticalAlignment="Center" HorizontalAlignment="Center" Grid.Row="0" Grid.Column="0"&gt;
              &lt;TextBlock&gt;Testing 1&lt;/TextBlock&gt;
          &lt;/Border&gt;
          &lt;Border Grid.IsSharedSizeScope="True"  Margin="2" VerticalAlignment="Center" HorizontalAlignment="Center" Grid.Row="0" Grid.Column="1"&gt;
              &lt;TextBlock&gt;Testing 2&lt;/TextBlock&gt; &lt;/Border&gt;
          &lt;Border Grid.IsSharedSizeScope="True"  Margin="2" VerticalAlignment="Center" HorizontalAlignment="Center" Grid.Row="0" Grid.Column="2"&gt;
              &lt;TextBlock&gt;Testing 2&lt;/TextBlock&gt;
          &lt;/Border&gt;
          &lt;Border Grid.IsSharedSizeScope="True" Margin="2" VerticalAlignment="Center" HorizontalAlignment="Center" Grid.Row="1" Grid.Column="0"&gt;
              &lt;TextBlock&gt;Testing 3&lt;/TextBlock&gt;
          &lt;/Border&gt;
          &lt;Border Grid.IsSharedSizeScope="True"  Margin="2" VerticalAlignment="Center" HorizontalAlignment="Center" Grid.Row="1" Grid.Column="1"&gt;
              &lt;TextBlock&gt;Testing 4&lt;/TextBlock&gt;&lt;/Border&gt;
          &lt;Border Grid.IsSharedSizeScope="True"  Margin="2" VerticalAlignment="Center" HorizontalAlignment="Center" Grid.Row="1" Grid.Column="2"&gt;
              &lt;TextBlock&gt;Testing 5&lt;/TextBlock&gt;&lt;/Border&gt;
          &lt;Border Grid.IsSharedSizeScope="True"  Margin="2" VerticalAlignment="Center" HorizontalAlignment="Center" Grid.Row="3" Grid.Column="0"&gt;
              &lt;TextBlock&gt;Testing 6&lt;/TextBlock&gt;&lt;/Border&gt;
          &lt;Border Grid.IsSharedSizeScope="True"  Margin="2" VerticalAlignment="Center" HorizontalAlignment="Center" Grid.Row="3" Grid.Column="1"&gt;
              &lt;TextBlock&gt;Testing 7&lt;/TextBlock&gt;&lt;/Border&gt;
          &lt;Border Grid.IsSharedSizeScope="True"  Margin="2" VerticalAlignment="Center" HorizontalAlignment="Center" Grid.Row="3" Grid.Column="2"&gt;
              &lt;TextBlock&gt;Testing 8&lt;/TextBlock&gt;&lt;/Border&gt;
          &lt;GridSplitter Grid.Row="0"
                        Grid.Column="1"
                        Margin="1"
                        ResizeBehavior="PreviousAndCurrent"
                        HorizontalAlignment="Left" 
                          VerticalAlignment="Stretch"
                          Background="Black" 
                          ShowsPreview="true"
                          ResizeDirection="Columns"
                          Width="2"/&gt;
          &lt;GridSplitter Grid.Row="1"
                        Grid.Column="1"
                        Margin="1"
                        ResizeBehavior="PreviousAndCurrent"
                        HorizontalAlignment="Left" 
                          VerticalAlignment="Stretch"
                          Background="Black" 
                          ShowsPreview="true"
                          ResizeDirection="Columns"
                          Width="2"/&gt;
          &lt;GridSplitter Grid.Row="2" 
                        Grid.Column="1"
                        Margin="1"
                        ResizeBehavior="PreviousAndCurrent"
                        HorizontalAlignment="Left" 
                          VerticalAlignment="Stretch"
                          Background="Black" 
                          ShowsPreview="true"
                          ResizeDirection="Columns"
                          Width="2"/&gt;
          &lt;GridSplitter Grid.Row="2" 
                        Grid.Column="1"
                        Margin="1"
                        ResizeBehavior="PreviousAndCurrent"
  
                        HorizontalAlignment="Stretch" 
                          VerticalAlignment="Top"
                          Background="Black" 
                          ShowsPreview="true"
                          ResizeDirection="Columns"
                          Width="2"/&gt;
          &lt;GridSplitter Grid.Row="0" 
                        Grid.Column="2"
                        Margin="1"
                        ResizeBehavior="PreviousAndCurrent"
                        HorizontalAlignment="Left" 
  
                        VerticalAlignment="Stretch"
                          Background="Black" 
                          ShowsPreview="true"
                          ResizeDirection="Columns"
                          Width="2"/&gt;
          &lt;GridSplitter Grid.Row="1" 
                        Grid.Column="2"
                        Margin="1"
                        ResizeBehavior="PreviousAndCurrent"
                        HorizontalAlignment="Left" 
                          VerticalAlignment="Stretch"
                          Background="Black" 
                          ShowsPreview="true"
                          ResizeDirection="Columns"
                          Width="2"/&gt;
          &lt;GridSplitter Grid.Row="2" 
                        Grid.Column="2"
                        Margin="1"
                        ResizeBehavior="PreviousAndCurrent"
                        HorizontalAlignment="Left" 
                          VerticalAlignment="Stretch"
                          Background="Black" 
                          ShowsPreview="true"
                          ResizeDirection="Columns"
                          Width="2"/&gt;
          &lt;GridSplitter Grid.Row="1"
                        Grid.Column="0"
                        Margin="1"
                        ResizeBehavior="PreviousAndCurrent"
                        HorizontalAlignment="Stretch" 
                          VerticalAlignment="Top"
                          Background="Black" 
                          ShowsPreview="true"
                          ResizeDirection="Rows"
                          Height="2"/&gt;
          &lt;GridSplitter Grid.Row="2"
                        Grid.Column="0"
                        Margin="1"
                        ResizeBehavior="PreviousAndCurrent"
                        HorizontalAlignment="Stretch" 
                          VerticalAlignment="Top"
                          Background="Black" 
                          ShowsPreview="true"
                          ResizeDirection="Rows"
                          Height="2"/&gt;
          &lt;GridSplitter Grid.Row="1" 
                        Grid.Column="1"
                        Margin="1"
                        ResizeBehavior="PreviousAndCurrent"
                        HorizontalAlignment="Stretch" 
                          VerticalAlignment="Top"
                          Background="Black" 
                          ShowsPreview="true"
                          ResizeDirection="Rows"
                          Height="2"/&gt;
          &lt;GridSplitter Grid.Row="2" 
                        Grid.Column="1"
                        Margin="1"
                        ResizeBehavior="PreviousAndCurrent"
                        HorizontalAlignment="Stretch" 
                          VerticalAlignment="Top"
                          Background="Black" 
                          ShowsPreview="true"
                          ResizeDirection="Rows"
                          Height="2"/&gt;
          &lt;GridSplitter Grid.Row="1" 
                        Grid.Column="2"
                        Margin="1"
                        ResizeBehavior="PreviousAndCurrent"
                        HorizontalAlignment="Stretch" 
                          VerticalAlignment="Top"
                          Background="Black" 
                          ShowsPreview="true"
                          ResizeDirection="Rows"
                          Height="2"/&gt;
          &lt;GridSplitter Grid.Row="2" 
                        Grid.Column="2"
                        Margin="1"
                        ResizeBehavior="PreviousAndCurrent"
                        HorizontalAlignment="Stretch" 
                          VerticalAlignment="Top"
                          Background="Black" 
                          ShowsPreview="true"
                          ResizeDirection="Rows"
                          Height="2"/&gt;
      &lt;/Grid&gt;
  </code></pre>
  
  <p>I want it to behave in a way that individual cell in the Grid shall be resized.</p>
  
  <ol>
  <li>At app start</li>
  </ol>
  
  <p><a href="https://i.stack.imgur.com/9FVED.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9FVED.png" alt="Here What it looks at app start"></a></p>
  
  <ol start="2">
  <li>While resizing via grid splitter:</li>
  </ol>
  
  <p><a href="https://i.stack.imgur.com/OaTFm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OaTFm.png" alt="While resizing"></a></p>
  
  <ol start="3">
  <li>After Reisize:</li>
  </ol>
  
  <p><a href="https://i.stack.imgur.com/eu2kq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eu2kq.png" alt="After resize"></a></p>
  
  <p><strong>I wanted that Only Grid[ 0][ 0] and Grid[ 0][ 1] to be resized</strong></p>