# Scroll Modes Basics

The [Angular Grid](https://www.telerik.com/kendo-angular-ui-develop/components/grid) provides options for rendering its content in a [scrollable](https://www.telerik.com/kendo-angular-ui-develop/components/grid/scroll-modes#scrollable-mode) or [non-scrollable](https://www.telerik.com/kendo-angular-ui-develop/components/grid/scroll-modes#non-scrollable-mode) mode. To configure the desired scroll mode, use the `scrollable` property.

You can also enable the virtual scroll mode of the Grid by setting `scrollable` to `virtual`. For more information, refer to the article on [virtual scrolling](https://www.telerik.com/kendo-angular-ui-develop/components/grid/scroll-modes/virtual).

## Scrollable Mode

When scrolling is enabled, the content of the Grid is rendered as tables—one for the header area, another one for the scrollable data area, and a third one for the footer area. This behavior ensures that the header and footer areas of the Grid are always visible while the user scrolls vertically.

### Getting Started

The scrollable mode of the Grid is enabled by default. You can configure the scrollable behavior through the [`scrollable`](https://www.telerik.com/kendo-angular-ui-develop/components/grid/api/gridcomponent#scrollable) option.

By default, the Grid is as high as its content and as wide as the available space. To configure the height of the Grid, either set its [`height`](https://www.telerik.com/kendo-angular-ui-develop/components/grid/api/gridcomponent#height) input or use the `style` HTML property. To configure the width of the Grid, use the `style` HTML property. If the height or width of the Grid content exceeds the height or width of the Grid itself, the Grid renders a vertical or horizontal scrollbar respectively.

> To enable horizontal scrolling, set the width of all columns.

The following example demonstrates the scrollable mode of the Grid.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/grid/scrolling/basic-usage/source.txt)

### Endless Scrolling

After the user scrolls to the end of the page, the Grid enables you to load more records by appending additional pages of data on demand. To set the endless scrolling feature, use the [`scrollBottom`](https://www.telerik.com/kendo-angular-ui-develop/components/grid/api/gridcomponent#scrollbottom) event of the Grid.

The following example demonstrates how to implement endless scrolling with local data.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/grid/scrolling/endless-scrolling/source.txt)

The following example demonstrates how to implement endless scrolling with remote data.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/grid/scrolling/endless-scrolling-remote/source.txt)

### Conditional Scrolling

Use an Angular [style property binding](https://angular.dev/guide/templates/binding#css-class-and-style-property-bindings) to set the [`max-height`](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/max-height) CSS property of the Grid. For example, `[style.maxHeight.px]="400"` sets the maximum height to 400 pixels.

The Grid expands until it reaches the specified maximum height. When the content exceeds that height, the Grid displays a vertical scrollbar and keeps its header, content, and footer aligned.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/grid/configuration/scrollable-on-demand/source.txt)

## Programmatically Scrolling the Grid

The Grid lets you programmatically control its scroll position and manually scroll to:

* [A specific row or column index](https://www.telerik.com/kendo-angular-ui-develop/components/grid/scroll-modes#scrolling-to-a-specific-row-and-column)—Scroll to a row using numeric values.
* [A desired data item](https://www.telerik.com/kendo-angular-ui-develop/components/grid/scroll-modes#scrolling-to-a-specific-item)—Scroll to a row using data item objects.

Consider the following specifics when programmatically scrolling the Grid:

* When the Grid has virtualization enabled and the provided index or item is not visible in the current view, the `scrollTo()` and `scrollToItem()` methods will scroll the component to the position of the specified index or item. This operation will trigger the [`pageChange`](https://www.telerik.com/kendo-angular-ui-develop/components/grid/api/gridcomponent#pagechange) or [`dataStateChange`](https://www.telerik.com/kendo-angular-ui-develop/components/grid/api/gridcomponent#datastatechange) event.
* When the Grid uses paging and the provided index or item is not available on the current page, the component will not be scrolled and the scroll position will not change.
* When the grouping or [`Master-Detail`](https://www.telerik.com/kendo-angular-ui-develop/components/grid/master-detail) feature is enabled, the `scrollTo()` and `scrollToItem()` methods will scroll to the provided index or item regardless of the type of the row. The specifics about paging and virtual scrolling still apply.

### Scrolling To a Specific Row and Column

The Grid allows you to scroll to a specific row or column by using the built-in [`scrollTo()`](https://www.telerik.com/kendo-angular-ui-develop/components/grid/api/gridcomponent#scrollto) method. The method accepts as an argument an object of type [`ScrollRequest`](https://www.telerik.com/kendo-angular-ui-develop/components/grid/api/scrollrequest) that allows you to specify the zero-based row and column index of the record to which the component must scroll.

> Starting with `v15.3.0`, the Grid provides a coherent behavior of the built-in `scrollTo()` method regardless of the exact component configuration.

The following example demonstrates the behavior of the built-in `scrollTo()` method inside a Grid with paging enabled.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/grid/scrolling/scrollto/source.txt)

### Scrolling to a Specific Item

You can programmatically scroll the Grid component to a specific item by using the built-in [`scrollToItem()`](https://www.telerik.com/kendo-angular-ui-develop/components/grid/api/gridcomponent#scrolltoitem) method. The method accepts as argument an object of type [`ScrollToItemRequest`](https://www.telerik.com/kendo-angular-ui-develop/components/grid/api/scrolltoitemrequest) which has two properties:

* `idField`—Represents the unique data identifier from the Grid data items.
* `id`—Sets the value of the `idField` data identifier.

The following example demonstrates the `scrollToItem()` method in action.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/grid/scrolling/scrolltoitem/source.txt)

## Non-Scrollable Mode

When the non-scrollable mode is enabled, the Grid renders its data as a single table and the scrollbar is not displayed. To define a non-scrollable Grid, set [`scrollable`](https://www.telerik.com/kendo-angular-ui-develop/components/grid/api/gridcomponent#scrollable) to `none`.

## Suggested Links

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