title: GridView width inherited from parent
body: <p>I have a <code>StackPanel</code> with a fixed width. Inside that <code>StackPanel</code> I have a <code>GridView</code>, which <code>Width</code> should be limited to its parent width (smth like Width="*").</p>
  
  <p>My sample XAML:</p>
  
  <pre><code>&lt;StackPanel Orientation="Horizontal" Width="300" Height="300"&gt;
          &lt;TextBox Width="50" Margin="0" Height="50" Background="Blue"&gt;&lt;/TextBox&gt;
          &lt;GridView &gt;
              &lt;GridView.ItemsPanel&gt;
                  &lt;ItemsPanelTemplate&gt;
                      &lt;WrapGrid Orientation="Horizontal" FlowDirection="LeftToRight" /&gt;
                  &lt;/ItemsPanelTemplate&gt;
              &lt;/GridView.ItemsPanel&gt;
              &lt;GridView.Items&gt;
                  &lt;TextBox Width="50" Margin="0" Height="50" Background="Green"&gt;&lt;/TextBox&gt;
                  &lt;TextBox Width="50" Margin="0" Height="50" Background="Green"&gt;&lt;/TextBox&gt;
                  &lt;TextBox Width="50" Margin="0" Height="50" Background="Green"&gt;&lt;/TextBox&gt;
                  &lt;TextBox Width="50" Margin="0" Height="50" Background="Green"&gt;&lt;/TextBox&gt;
                  &lt;TextBox Width="50" Margin="0" Height="50" Background="Green"&gt;&lt;/TextBox&gt;
              &lt;/GridView.Items&gt;
          &lt;/GridView&gt;
      &lt;/StackPanel&gt;
  </code></pre>
  
  <p>In this example the <code>GridView</code> width is wider than the parent, so some of its items are not displayed (not wrapped). When I set <code>GridView</code> width to a fixed value items are wrapped, but I can't use fixed value in my project.</p>