Note that there are some explanatory texts on larger screens.

plurals
  1. POGridSplitter: Scale cell that is not directly adjacent to GridSplitter
    text
    copied!<p>I have a WPF Grid with four columns containing only one GridSplitter. Two of the columns (0 and 3) are scalable, but one scalable column is not directly adjacent to the GridSplitter (column 2). </p> <p>Columns 0 and 3 must have the same initial size. So I can't put column 0 and 1 in a nested grid.</p> <p>How can I solve this?</p> <pre><code>&lt;Grid Height="40"&gt; &lt;Grid.ColumnDefinitions&gt; &lt;ColumnDefinition Width="*" /&gt; &lt;ColumnDefinition Width="Auto" /&gt; &lt;ColumnDefinition Width="Auto" /&gt; &lt;ColumnDefinition Width="*" /&gt; &lt;/Grid.ColumnDefinitions&gt; &lt;Rectangle Grid.Column="0" Fill="Blue" Margin="8" /&gt; &lt;Rectangle Grid.Column="1" Fill="Yellow" Margin="8" Width="24" /&gt; &lt;GridSplitter Grid.Column="2" Width="8" VerticalAlignment="Stretch" /&gt; &lt;Rectangle Grid.Column="3" Fill="Red" Margin="8" /&gt; &lt;/Grid&gt; </code></pre> <p><strong>Edit:</strong> I solved it with the help of <a href="https://stackoverflow.com/users/1262265/nickolay-laptev">nickolay.laptev</a></p> <pre><code>&lt;Grid Height="40"&gt; &lt;Grid.ColumnDefinitions&gt; &lt;ColumnDefinition Width="*" /&gt; &lt;ColumnDefinition Width="Auto" /&gt; &lt;ColumnDefinition Width="*" /&gt; &lt;/Grid.ColumnDefinitions&gt; &lt;Rectangle Grid.Column="0" Fill="Blue" Margin="8" /&gt; &lt;Rectangle Grid.Column="1" Fill="Yellow" Margin="8 8 16 8" Width="24" /&gt; &lt;GridSplitter Grid.Column="1" Width="8" VerticalAlignment="Stretch" HorizontalAlignment="Right" ResizeBehavior="PreviousAndNext" /&gt; &lt;Rectangle Grid.Column="2" Fill="Red" Margin="8" /&gt; &lt;/Grid&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload