I am trying to use a gridsplitter to resize the grid rows, but I don’t get the behaviour which I expected.
<Grid x:Name="LayoutRoot" Background="White" Width="300">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0">
<StackPanel Orientation="Horizontal">
<TextBlock Height="23" Text="Inventory:"/>
</StackPanel>
<sdk:DataGrid AutoGenerateColumns="False" Height="Auto" Name="dataGrid1" HorizontalAlignment="Left" IsReadOnly="True" >
<sdk:DataGrid.Columns>
<sdk:DataGridTextColumn Binding="{Binding Name}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="Name" IsReadOnly="True" />
<sdk:DataGridTextColumn Binding="{Binding CreatedDate}" Header="Created Date" />
<sdk:DataGridTextColumn Binding="{Binding ChangedDate}" Header="Last Edited" />
</sdk:DataGrid.Columns>
</sdk:DataGrid>
</StackPanel>
<sdk:GridSplitter Grid.Row="1" Height="10" Width="300" HorizontalAlignment="Stretch"/>
<Grid Grid.Row="2"></Grid>
</Grid>
Before move of splitter

After move of splitter

I would like the datagrid to resize it’s content, in which a scrollbar should be present when resizing it.
The problem is you have the DataGrid in a
StackPanel. A vertically oriented stack panel has not vertical boundary hence the data grid renders its full height unware that it is going to be clipped. You should use another Grid to get your desired result:-