Keep Scroll Bar At Bottom

Hi all!


Question - Right now with my SfDataGrid, the Horizonal scroll bar is fixed to the last row in the Datagrid, is there anyway to keep it at the bottom of the datagrid?


Thanks! 


Attachment: Screenshot_20260409_085514_c176655e.png

1 Reply

SR Senthilkumar Ranganathan Syncfusion Team April 10, 2026 12:13 PM UTC

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.


Loader.
Up arrow icon