New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial
OnClientItemsRequesting
The OnClientItemsRequesting client-side event occurs when EnableLoadOnDemand is True and the listbox is about to send a server-side request to load more items. This event fires before the items are added to the listbox' Items collection.
The event handler receives two parameters:
-
The instance of the listbox firing the event.
-
An eventArgs parameter containing the following methods:
-
get_context returns a context object (implements IDictionary) that is passed to the server-side code that handles the request for items.
-
set_cancel lets you prevent the items request.
This event can be used to cancel the load-on-demand request.
JavaScript
<script type="text/javascript">
var shouldCancelEvent = true;
function OnClientItemsRequesting(sender, eventArgs) {
eventArgs.set_cancel(shouldCancelEvent);
}
</script>