Getting Started with the Kendo UI for Angular ListView

This guide provides the information you need to start using the Kendo UI for Angular ListView—it includes instructions about the recommended installation approach, the code for running the project, and links to additional resources.

As of version 17.0.0, Angular makes standalone component enabled by default. If you use NgModules, refer to these articles:


After the completion of this guide, you will be able to achieve an end result as demonstrated in the following example.

Example
View Source
Change Theme:

Setting Up Your Angular Project

Before you start with the installation of any Kendo UI for Angular control, ensure that you have a running Angular project. The prerequisites to accomplish the installation of the components are always the same regardless of the Kendo UI for Angular package you want to use, and are fully described in the section on setting up your Angular project.

Installing the Component

The following command demonstrates an efficient, automated method for adding packages using the Angular CLI through the ng-add command. This approach saves time and effort by executing a series of commands in a single step, which otherwise need to be run individually. Refer to the Manual Setup for more details.

To add the Kendo UI for Angular ListView package:

  1. Run the following command:

    ng add @progress/kendo-angular-listview

    As a result, the ng-add command will perform the following actions:

    • Add the @progress/kendo-angular-listview package as a dependency to the package.json file.
    • Add all required peer dependencies to the package.json file.
    • Register the Kendo UI Default theme in the angular.json file.
    • Trigger npm install to install the theme and all peer packages that are added.
  2. Import the KENDO_LISTVIEW utility array in your standalone component to enable the entire feature set of the ListView:

    import { Component } from '@angular/core';
    import { KENDO_LISTVIEW } from '@progress/kendo-angular-listview';
    
    @Component({
        standalone: true,
        selector: 'my-app',
        imports: [KENDO_LISTVIEW]
    })

Using the Component

  1. After successfully installing the ListView package and importing its component, add the following code in the app.component.html file:

    <kendo-listview
        [data]="products"
        [itemClass]="{ 'item-border': true }"
    >
        <ng-template kendoListViewItemTemplate let-dataItem="dataItem">
            {{ dataItem.productName }}
        </ng-template>
    </kendo-listview>
  2. Bind the data property to a collection that will be used to populate the ListView in the app.component.ts file.

    public products = [
        {
            ProductID: 1,
            ProductName: 'Chai'
        },
        {
            ProductID: 2,
            ProductName: 'Chang'
        },
        ...
    ]
  3. Apply a custom CSS class to customize the layout of each item by setting the itemClass property of the component:

    .item-border {
        padding: 10px;
        border-bottom: 1px solid lightgrey;
    }
  4. Build and serve the application by running the following command in the root folder.

    ng serve
  5. Point your browser to http://localhost:4200 to see the Kendo UI for Angular ListView component on the page.

Activating Your License Key

As of December 2020, using any of the UI components from the Kendo UI for Angular library requires either a commercial license key or an active trial license key. If your application does not contain a Kendo UI license file, activate your license key.

Next Steps

Learning Resources