Hello Vivek,
You're correct, those are the two options. Either one will work for you, the option to use is up to you and how your application is being built.
The event approach is good if you're doing your work mostly in the code-behind. However, if you're using MVVM, I recommend the
ListViewLoadOnDemandCollection, so you can do the work in the view model. The ListViewLoadOnDemandCollection and the RadListView work together closely to provide a smooth fetch/busy/result experience.
This section in the documentation shows how to use the ListViewLoadOnDemandCollection.
Paging
Note that the RadListView will not automatically handle paging, you'll need to know how your API handles paging/item count and track that in the view model so you know what to send the API when the next set of items are needed.
Most APIs return a page number with a set of items, for example:
However, if it doesn't, you'll need to keep track yourself.
For an example of keeping track of how many time the fetch method is used, see the following line in the documentation's code example:
Fetch Time
The RadListView will show a busy indicator will show a busy indicator while the fetch is occurring. If you look at the documentation's code example, you'll see that we have in there to simulate a 4 second fetch time.
Demos
You can find demos of this in action on your PC in the SDKBrowser examples. Find the solution at the following location:
C:\Program Files (x86)\Progress\Telerik UI for Xamarin R3 2017\Examples\XamarinForms\SDKBrowser.sln
After you open the solution, drill down to the following project folder for the specific examples:
SDKBrowser (PCL project) > Examples > ListView > LoadOnDemand folder for the examples.
We try to provide you with flexible options: Manual, Automatic and Event or Collection, but ultimately it's up to you to choose the one that makes the most sense for your project and API.
I hope this information helps.
Regards,
Lance | Tech Support Engineer, Sr.
Progress Telerik
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Feedback Portal
and vote to affect the priority of the items