# Grid Legacy Virtualization Requirements

## Environment

<table>
    <tbody>
	    <tr>
	    	<td>Product</td>
	    	<td>Progress® Kendo UI for Angular Grid</td>
	    </tr>
    </tbody>
</table>

## Description

This article explains the requirements for enabling legacy virtualization in the [Kendo UI for Angular Grid](https://www.telerik.com/kendo-angular-ui/components/grid) for versions **below 19**. Starting with [version 19](https://www.telerik.com/kendo-angular-ui/components/changelogs/kendo-angular-ui#v19.0.0), 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:

| Property                                                                                                        | Requirement (v < 19) | Requirement (v ≥ 19) | Description                                                                                                     |
| --------------------------------------------------------------------------------------------------------------- | -------------------- | -------------------- | --------------------------------------------------------------------------------------------------------------- |
| [`height`](https://www.telerik.com/kendo-angular-ui/components/grid/api/gridcomponent#height)                   | Required             | Required             | Set a fixed height for the Grid, either through the input or CSS.                                               |
| [`scrollable`](https://www.telerik.com/kendo-angular-ui/components/grid/api/gridcomponent#scrollable)           | Required             | Required             | Set to `"virtual"`.                                                                                             |
| [`data`](https://www.telerik.com/kendo-angular-ui/components/grid/api/gridcomponent#data)                       | Required             | Required             | Provide data as `GridDataResult` with a `total` field.                                                          |
| [`rowHeight`](https://www.telerik.com/kendo-angular-ui/components/grid/api/gridcomponent#rowheight)             | Required             | Optional             | Set the row height for calculations (v < 19: for calculations only, v ≥ 19: sets actual row height in the DOM). |
| [`skip`](https://www.telerik.com/kendo-angular-ui/components/grid/api/gridcomponent#skip)                       | Required             | Optional             | Set the number of rows to skip when scrolling.                                                                  |
| [`pageSize`](https://www.telerik.com/kendo-angular-ui/components/grid/api/gridcomponent#pagesize)               | Required             | Optional             | Set the number of rows to display in the Grid. Should be at least three times the visible rows in the Grid.     |
| [`detailRowHeight`](https://www.telerik.com/kendo-angular-ui/components/grid/api/gridcomponent#detailrowheight) | Optional             | Optional             | Set 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)">
  
</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.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/knowledge-base/grid-virtual-legacy-requirements/source.txt)

## Suggested Links

* [Grid Virtualization Documentation](https://www.telerik.com/kendo-angular-ui/components/grid/scroll-modes/virtual)
* [API Reference of the GridComponent](https://www.telerik.com/kendo-angular-ui/components/grid/api/gridcomponent)
* [API Index of the Grid](https://www.telerik.com/kendo-angular-ui/components/grid/api)
