New to Kendo UI for AngularStart a free 30-day trial

Grid Legacy Virtualization Requirements

Environment

ProductProgress® Kendo UI for Angular Grid

Description

This article explains the requirements for enabling legacy virtualization in the Kendo UI for Angular Grid for versions below 19. Starting with version 19, most of these requirements are optional or handled automatically by the Grid, making virtualization more streamlined.

Requirements

The following configuration properties are required for legacy virtualization in versions earlier than 19. In version 19 and above, most of these are optional and handled automatically by the Grid:

PropertyRequirement (v < 19)Requirement (v ≥ 19)Description
heightRequiredRequiredSet a fixed height for the Grid, either through the input or CSS.
scrollableRequiredRequiredSet to "virtual".
dataRequiredRequiredProvide data as GridDataResult with a total field.
rowHeightRequiredOptionalSet the row height for calculations (v < 19: for calculations only, v ≥ 19: sets actual row height in the DOM).
skipRequiredOptionalSet the number of rows to skip when scrolling.
pageSizeRequiredOptionalSet the number of rows to display in the Grid. Should be at least three times the visible rows in the Grid.
detailRowHeightOptionalOptionalSet if using detail rows.

For grouping the kendoGridGroupBindingdirective is required to be set for the Grid data. The directive supports only the processing of in-memory data and you have to provide the full set of data that will be processed.

html
<kendo-grid [kendoGridGroupBinding]="data"></kendo-grid>

Example

Example setup for legacy virtualization:

css
/* Sets the row height for the Grid */
.k-grid .k-grid-content td {
  white-space: nowrap;
  line-height: 20px;
  padding: 8px 12px;
}
html
<kendo-grid
  [data]="gridData"
  [height]="400"
  scrollable="virtual"
  [rowHeight]="36"
  [skip]="skip"
  [pageSize]="pageSize"
  (pageChange)="onPageChange($event)">
  <!-- ...columns... -->
</kendo-grid>
typescript
public gridData: GridDataResult = { data: [], total: 0 };
public skip = 0;
public pageSize = 100;

public onPageChange(event: PageChangeEvent): void {
  this.skip = event.skip;
  // Load data for the current page
}

The following example demonstrates the legacy setup for both data binding and grouping virtualization. Use the switch button to toggle between both bindings.

Change Theme
Theme
Loading ...