Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You say: "All cells of both grids have no size specifications (Auto Sized)" - this is where the problem is. When the <code>grid</code> cell is <code>auto</code> sized the <code>grid</code> gives the content in that cell as much space as it wants (doesn't matter if it fits in the window or not). To fix it you have to put your <code>DataGrid</code> into a star-sized cell. </p> <pre><code>&lt;Grid&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition Height="Auto"/&gt; &lt;RowDefinition Height="*"/&gt; &lt;/Grid.RowDefinitions&gt; &lt;Border Grid.Row="0"&gt; &lt;!-- Content that will take as much space as it wants --&gt; &lt;/Border&gt; &lt;Border Grid.Row="1"&gt; &lt;!-- Content that will take all the remaining space --&gt; &lt;/Border&gt; &lt;/Grid&gt; </code></pre> <p><strong>UPDATE:</strong> Based on the screenshots you provided...</p> <p>First, get rid of the <code>DockPanel</code> in the top level control. <code>DockPanel</code> gives its child all the space it asks for. If it is not a "fill" child (<code>LastChildFill="True"</code>). Use <code>grid</code> instead of <code>DockPanel</code> (i.e. at the top level a <code>grid</code> with two rows - one auto-sized for the menu and the second star-size for the rest of the stuff, the in that star-size row put another <code>grid</code> for you items controls, etc.).</p> <p>Remember, whenever you put the content either in an auto-size cell in a grid or in a <code>DockPanel</code> with dock type different than <code>Fill</code>, the content will take as much space as it required without showing a scroll bar (it will go beyond the window).</p> <p><strong>UPDATE 2:</strong> Looking at the new screenshots (see comments to this post)...</p> <p>OK, I think I see the problem. The thing is that <code>ItemsControl</code> uses <code>StackPanel</code> to display its children, but <code>StackPanel</code> also gives its children all the space they want (your <code>DataGrid</code> thinks that it has enough space to render itself without scroll bars).</p> <p>To fix that you need to put your items controls inside an <code>ScrollViewer</code> like this:</p> <pre><code>&lt;ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto"&gt; &lt;ItemsControl ... /&gt; &lt;/ScrollViewer&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