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 04:35 AM

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    
<sfPager:SfDataPager x:Name="dataPager"   
<sfGrid:SfDataGrid Grid.Row="1"   
                               ItemsSource="{Binding PagedSource, Source={x:Reference dataPager}}">   
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.   
Balasubramani Sundaram 

Live Chat Icon For mobile
Up arrow icon