New to Kendo UI for Angular? Start a free 30-day trial


ProductProgress® Kendo UI® for Angular DropDowns


How can I implement remote data virtualization in a Kendo UI for Angular DropDownList?


To achieve remote data virtualization with the DropDownList component, utilize the rxjs BehaviorSubject which relies on the arguments provided by the pageChange event. The pageChange event is private and is emitted by the internal kendo-list component used in the DropDownList popup.

  1. Create the stateChange BehaviorSubject and pass the current state to it.

        public state: any = {
            skip: 0,
            take: 50
        private stateChange = new BehaviorSubject<any>(this.state);
  2. Use switchMap to cancel the initial stateChange observable and attach a new one which sends a request to get the remote data for the current state. When subscribing, create a data array which consists of the returned data and empty objects so that it simulates the complete data array.

        constructor(service: OrdersService) {
                switchMap(state => {
                    if ( > 0) {
                    this.loading = true;
                    this.state = state;
                    return service.fetch(state);
                .subscribe((response: any) => {
                if ( === 0) {
                    // even though we are getting only 50 items from the response we simulate an array that consists of all data items
                    new Array( - this.state.take)
                } else {
                    // if there is already loaded data, it is replaced with the latest received data
          , this.state.take,;
                this.loading = false;
  3. Handle the pageChange event of the internal kendo-list component. Consequently, pass the emitted state to the stateChange BehaviorSubject.

        public onOpened() {
            // optionsList is a reference to the internal kendo-list component used in the DropDownList popup.
            // Pass the current state to the stateChange BehaviorSubject on each pageChange event.
            this.dropdownlist.optionsList.pageChange.subscribe(state =>
  4. Within the kendoDropDownListItemTemplate, display a span with the k-skeleton, k-skeleton-text, and k-skeleton-wave classes for the items which don't exist.

        <ng-template kendoDropDownListItemTemplate let-dataItem>
            <div *ngIf="!dataItem; else elseBlock">
            <span class="k-skeleton k-skeleton-text k-skeleton-wave"></span>
            <ng-template #elseBlock>{{ dataItem.ShipName }}</ng-template>

The following example demonstrates the full implementation of the suggested approach.

View Source
Change Theme:

In this article

Not finding the help you need?