How to keep the pager centered after data load in .NET MAUI DataGrid?
This sample demonstrates how to keep the SfPager centered in a .NET MAUI SfDataGrid. It shows that the pager remains centered by using layout settings that keep it fixed in the middle. This ensures that the pager doesn’t move or shift when the data loads or when the grid changes size. As a result, the UI stays clean, and the pager always remains centered.
XAML
<ContentPage.Content>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<pager:SfDataPager x:Name ="dataPager"
Grid.Row="1"
PageSize="15"
NumericButtonCount="10"
Source="{Binding OrderInfoCollection}"
WidthRequest="500"
HorizontalOptions="Center"
Margin="0,5">
</pager:SfDataPager>
<syncfusion:SfDataGrid x:Name="dataGrid"
Grid.Row="0"
ColumnWidthMode="Fill"
ItemsSource="{Binding Source={x:Reference dataPager}, Path=PagedSource}">
</syncfusion:SfDataGrid>
</Grid>
</ContentPage.Content>
Download the complete sample from GitHub
Conclusion
I hope you enjoyed learning about how to keep the pager centered after data load in .NET MAUI DataGrid.
You can refer to our .NET MAUI DataGrid’s feature tour page to learn about its other groundbreaking feature representations. You can also explore our .NET MAUI DataGrid Documentation to understand how to present and manipulate data.
For current customers, you can check out our .NET MAUI components on the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to explore our .NET MAUI DataGrid and other .NET MAUI components.
If you have any queries or require clarifications, please let us know in the comments below. You can also contact us through our support forums,Direct-Trac or feedback portal, or the feedback portal. We are always happy to assist you!