There is a listbox, located in the grid, between two rows. You need to stretch the ListBox the entire length between these rows. And regardless of the number of entries in the ListBox. The whole grid should fit on the screen.
<Grid Name="grdEmployeeFilterAndList"> <Grid.RowDefinitions> <RowDefinition Height="auto"/> <RowDefinition Height="auto"/> <RowDefinition Height="auto"/> </Grid.RowDefinitions> <StackPanel x:Name="employeeListStackPanel" Grid.Row="0"> </StackPanel> <ListBox x:Name="lstEmployees" Grid.Row="1" Margin="6,5,8,0" SelectionChanged="lst_SelectionChanged" HorizontalContentAlignment="Stretch" ItemTemplate="{StaticResource PersonDataTemplate}" SnapsToDevicePixels="True" Style="{DynamicResource ListBoxStyle1}"> <ListBox.ItemContainerStyle> <Style TargetType="{x:Type ListBoxItem}" BasedOn="{StaticResource {x:Type ListBoxItem}}"> <Setter Property="Control.Padding" Value="0"/> <EventSetter Event="MouseDoubleClick" Handler="lstEmployees_DoubleClick"/> <Style.Triggers> <Trigger Property="ListBoxItem.IsSelected" Value="True"> <Setter Property="Control.Background" Value="sc#1.000000, 0.769689, 0.831936, 1.000000" /> </Trigger> </Style.Triggers> </Style> </ListBox.ItemContainerStyle> </ListBox> <StackPanel Orientation="Horizontal" Grid.Row="2" Margin="0,0,0,5" HorizontalAlignment="Center"> </StackPanel> </Grid> Solution: Solution found: the problem was in the parent elements that stretched the window. I dealt with them + the @Mirdin solution helped (which would have worked as well if not for the parent elements).


