Hi Stanicb,
Thank you for using Syncfusion Products.
Regarding your query on how to use OnDemandPaging in SfDataGrid:
If you don’t set the UseOnDemandPaging property for the SfDataPager, the data collection(all page data) is entirely loaded initially to the SfDataPager. If you set the UseOnDemandPaging property as “True” for the SfDataPager, then the current page data only will be loaded and the other page data are loaded dynamically by hooking the OnDemandloading event. In the OnDemandloading event, use the LoadDynamicItems method to load the data for the corresponding page in SfDataPager dynamically.
When you use OnDemandPaging, SfDataPager.PagedSource loads only the current page data. Upon navigation to another page, OnDemandLoading event is fired which loads another set of data but maintains the previous page data also. When you navigate to previous page again, OnDemandLoading event will not fire as the data loaded would be maintained in cache. However for further performance enhancement if you do not want to maintain the previous page data, you can call Syncfusion.Data.PagedCollectionView.ResetCache() in OnDemandLoading event. ResetCache method call resets the cache except current page.
And you have to set the SfDataPager.Source because when paging is enabled we populate the data for SfDataGrid through the SfDataPager hence setting the Source in SfDataPager is mandatory.
We confirm that the issue “SfDataPager view initially not refresh when we set the PagedIndex for the SfDataGrid ” is a defect and we are able to reproduce the issue. The fix for this issue will be available in our upcoming 2017 Volume 2 Main Release scheduled for roll out in the last week of April. We appreciate your patience until then.
Thanks & Regards,
Sivaraman