Hi Anthony,
We have reviewed the
reported scenario. The issue occurs when the SfDataGrid
is placed inside a StackPanel. When a
SfDataGrid is hosted in a StackPanel, the StackPanel measures its children with
infinite height, causing the SfDataGrid
to expand and fit all rows.
As a result, the
grid’s internal ScrollViewer assumes that
the entire content is visible. Because of this, the horizontal scrollbar is
rendered at the bottom of the content (after the last row) instead of at the
bottom of the visible viewport.
To avoid this
behavior, place the SfDataGrid inside a Grid instead of a StackPanel. This allows the
control to receive a constrained height, ensuring that the scrollbar appears
correctly at the bottom of the SfDataGrid.
Code Snippet for placing SfDataGrid inside a Grid:
|
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- Other controls -->
<TextBlock Text="Employee Details"
FontWeight="Bold"
Margin="5"/>
<!-- SfDataGrid -->
<syncfusion:SfDataGrid
Grid.Row="1"
ItemsSource="{Binding Employees}"
AutoGenerateColumns="True" />
</Grid>
|
Gif Illustration:
Regards,
Senthilkumar Ranganathan.