Sample of usage SfDataGrid with paging from remote data with FreshMVVM

Hi, I've searched over the web for some references how to implements SfDataGrid with SfDataPager loading data from remote web service, using FreshMVVM with no success, because my own implementation don't work no way. My impression is that those controls doesn't work with MVVM approach, because almost behaviors are implementated with event delegate, and this force me to use workarounds something like this https://blog.xamarin.com/turn-events-into-commands-behaviors/ .

My scenario is:
1) Request data for initialize SfDataPager parameters (PageSize)
2) Request data to fill datasource and get the additional property totalRows that value represet the total data there are in server, then calculate and set SfDataPager.PageCount
3) those above steps are working very well but the problem is put everything together to work. The question is: whats is the order to set properties? what methods is needed to run? what properties are bindable? what is the moment to set SfDataPager.PagedSource to Source of the SfDataGrid? and so on, that are needed to get this working.

I don't found any refrence that cover this scenario, this would be a very common situation, tha would be very important to stay on documentation either knowledge base.

ps. I have notice that looks like the SfDataGrid detect that there are data in SfDataPager, but don't render those, because there is a vertical scrollbar on the page.

Could you provide a sample implementation that , I will be very happy with this help.

1 Reply

JA Jayaraman Ayyanar Syncfusion Team September 12, 2018 11:51 AM UTC

Hi Vinicius,  
  
Thanks for contacting Syncfusion support. 
  
We have analyzed your query for SfDataGrid with paging using FreshMVVM and we have prepared a sample for your requirement with the DataGrid with paging using FreshMvvm concept and you can download from the following link.  
  
  
Regards,  
Jayaraman.  


Loader.
Up arrow icon