Skip to content

SyncfusionExamples/How-to-keep-the-pager-centered-after-data-load-in-.NET-MAUI-DataGrid-SfDataGrid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

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

About

This demo shows how to keep the pager centered after data load in .NET MAUI DataGrid (SfDataGrid).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages