RadListBox now supports Load On Demand.
You could enable the functionality by setting the EnableLoadOnDemand
property to true and setting a Height to RadListBox. If the EnableLoadOnDemand
property is set to true, but there is no Height set, RadListBox will not utilize
on demand loading.
When LOD is turned on, RadListBox will load only the items that fit in the visible
area plus few items above and below it, for the sake of not triggering request on
a minor scrollbar move and smoother user experience. For this reason, on page load
RadListBox will always be displayed with its first items visible.
The DataSource property needs to be set each and every time the server is hit.
This is necessary, because when a request for the next portion of items is fired,
the RadListBox needs to calculate the position of the scroll and acquire the corresponding set of items.
They are not added to the Items collection and thus not allowing manipulating
them on the server. RadListBox Load on Demand is an entirely client feature.
Load on demand is triggered in the following occasions:
- Scroll using the mouse wheel - fires LOD as items are being scrolled.
- Scroll via moving the scrollbar - fires LOD on mouse up, i.e. the
items are going to be requested only after the user has finished scrolling.
- Access item using the API - You need to use the GetItemAsync
method instead of GetItem. GetItemAsync accepts two parameters,
the index of the item that you seek and a callback function in which the item will
be provided. If the sought item is loaded, RadListBox will immediately pass it to
the callback. If it is not, a request will be made to the server and upon retrieval
the item will be passed as an argument to the provided callback.
You can use RadAjaxLoadingPanel to display loading template between the AJAX requests.
Just place a loading panel on the page and set the RadListBox LoadingPanelID
property.