Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The control needs to stretch, that's all there should be to it:</p> <pre><code>&lt;MyControl HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/&gt; </code></pre> <p><code>Stretch</code> replaces setting achors to both respective sides.</p> <p>For help on panels see <a href="http://msdn.microsoft.com/en-us/library/ms754152.aspx" rel="noreferrer">this overview</a>. Also see the <a href="http://msdn.microsoft.com/en-us/library/ms745058.aspx" rel="noreferrer">documentation of the layout system</a>.</p> <p>Most controls automatically stretch, if you have a DataGrid it should stretch too, try this sample in <a href="http://kaxaml.com/" rel="noreferrer">Kaxaml</a>, it contains a DataGrid and a TextBlock which shows its size:</p> <pre><code>&lt;Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&gt; &lt;Grid&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition /&gt; &lt;RowDefinition Height="Auto"/&gt; &lt;/Grid.RowDefinitions&gt; &lt;DataGrid Name="grid"&gt; &lt;DataGrid.Columns&gt; &lt;DataGridTextColumn Binding="{Binding Name}" Header="Name"/&gt; &lt;DataGridTextColumn Binding="{Binding Tag}" Header="Occupation"/&gt; &lt;/DataGrid.Columns&gt; &lt;FrameworkElement Name="Skeet" Tag="Programmer"/&gt; &lt;FrameworkElement Name="Gravell" Tag="Programmer"/&gt; &lt;FrameworkElement Name="Steve" Tag="Coffee Getter"/&gt; &lt;/DataGrid&gt; &lt;TextBlock Grid.Row="1"&gt; &lt;TextBlock.Text&gt; &lt;MultiBinding StringFormat="{}{0}, {1}"&gt; &lt;Binding ElementName="grid" Path="ActualWidth"/&gt; &lt;Binding ElementName="grid" Path="ActualHeight"/&gt; &lt;/MultiBinding&gt; &lt;/TextBlock.Text&gt; &lt;/TextBlock&gt; &lt;/Grid&gt; &lt;/Window&gt; </code></pre> <p>If you size the window down the DataGrid's ScrollBars should appear.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

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