Docs

Documentation versions (currently viewingVaadin 25 (prerelease))

Add a Grid

Learn how to add a data grid to a Vaadin view.

In business applications, grids are commonly used to display tabular data. Vaadin’s Grid component provides a powerful and flexible way to present large datasets. However, the way you populate, filter, and sort the grid depends on the nature of your data.

Data in business applications typically falls into one of the following categories:

  • Static data: A fixed collection of objects held entirely in memory that never changes. This is typically reference data (for example, countries, categories, status types) that is either hardcoded or loaded once at application startup. Java enum constants also fall into this category. Filtering and sorting happen entirely in memory.

  • Buffered data: Data that is loaded from an application service where the entire filtered result set is fetched at once. Because all matching records are held in memory, sorting can happen locally without additional service calls. This approach works well when you can guarantee that filtered result sets remain small enough to fit in memory (for example, orders for a single customer, or tasks assigned to a user).

  • Paginated data: Data that is too large to fit in memory, even after filtering. It is loaded in chunks (pages) from an application service as needed. Both filtering and sorting are delegated to the service layer.

You can use the Grid component with all these data types, but the implementation details differ. Each data type has its own guide:

Static Data
Learn how to populate a grid with static data.
Buffered Data
Learn how to populate a grid with data from an application service.
Paginated Data
Learn how to populate a grid with paginated data from an application service.

For detailed information about binding data sets to UI components in Vaadin, see the Data Provider reference guide.