We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How can i set numeric button count without data count?

i am using the dataGrid with dataPager. I have big data that is about two thousand. So i can not get all data. i get ten datas for per page. Every change of page i get new 10 datas from server. So i have total data count and pagesize count, i want to show buttons according to as (total/pagesize). How can i do this.

For example :

I have 800 datas in server. I get 10 datas and pageSize = 10,
i want to show 80 buttons.



1 Reply

BS Balasubramani Sundaram Syncfusion Team August 27, 2019 09:35 AM UTC

Hi Mahmut,    
   
Thank you for contacting Syncfusion support.     
   
Your requirement can be achieved through “OnDemandLoding” support in our SfDataPager. OnDemanLoading which helps to manipulate the record on the time of button click through the “OnDemandLoading” event. In the OnDemandLoading event, use the LoadDynamicItems method to load data for the corresponding page in the SfDataPager.   
   
Please refer the below sample and code snippet.   
   
Code Snippet    
[Mainpage.xaml.cs]   
   
<sfPager:SfDataPager x:Name="dataPager"   
                                 OnDemandLoading="DataPager_OnDemandLoading"   
                                 UseOnDemandPaging="True"   
                                 NumericButtonCount="10"   
                                 PageSize="10"   
                                 PageCount="80"   
                                 Grid.Row="0"   
                                 />   
   
<sfGrid:SfDataGrid Grid.Row="1"   
                               x:Name="dataGrid"                                  
                               AutoGenerateColumns="False"                              
                               ColumnSizer="Star"                                                       
                               ItemsSource="{Binding PagedSource, Source={x:Reference dataPager}}">   
    .....   
</sfGrid:SfDataGrid>   
   
[Mainpage.xaml.cs]   
   
private void DataPager_OnDemandLoading(object sender, Syncfusion.SfDataGrid.XForms.DataPager.OnDemandLoadingEventArgs e)   
{   
     dataPager.LoadDynamicItems(e.StartIndex, viewModel.OrdersInfo.Skip(e.StartIndex).Take(e.PageSize));   
}   
   
   
  
   
   
   
Please let us know, if you need any further assistance on this.   
   
Regards,
Balasubramani Sundaram 


Loader.
Live Chat Icon For mobile
Up arrow icon