# Data Viewer Grid Component

## Overview

The data viewer components act as a display layer for the data in a connected data source. The data viewer grid displays your data in a grid.&#x20;

<div align="left"><img src="https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LAn5scXl2uqUJUOqkJo-84897653%2Fuploads%2Ft1TN1PCTZx3bfXrf6kwo%2FScreen%20Shot%202022-02-04%20at%2012.44.53%20PM.png?alt=media&#x26;token=01802657-fe92-43b8-8e1b-765f334054ab" alt="" width="375"></div>

## Properties

### Data Viewer Grid

<table><thead><tr><th width="229">Property</th><th width="184.33333333333331">Value</th><th>Description</th><th data-hidden>Description</th></tr></thead><tbody><tr><td>Data Source</td><td>References chosen data source</td><td>The <a href="../../../../getting-started/data-sources">data source</a> your data is pulled from.</td><td>The <a href="../../../../getting-started/data-sources">data source</a> your data is to be pulled from.</td></tr><tr><td>Table</td><td>References chosen table in data source</td><td>The table within your data source your data is pulled from.</td><td>Selected table from your data source.</td></tr><tr><td>Filter View</td><td>References filter view in table</td><td>The filter view within your table your data is pulled from.</td><td></td></tr><tr><td>Grid Appearance</td><td>Select from list</td><td>How your data will be displayed in your app.</td><td>How your data will be displayed in your app.</td></tr><tr><td>Populate Data</td><td>Select from lists</td><td>Map your data source's columns to the fields they will be displayed in.</td><td>Match the data source items with the fields of the selected row appearance.</td></tr><tr><td>Horizontal Scroll</td><td>True/False</td><td><p>True - data viewer scrolls horizontally </p><p>False - data viewer scrolls vertically</p></td><td></td></tr><tr><td>Empty text</td><td>Text</td><td>Text that will be displayed if there is no data in your data source to fill a data viewer field.</td><td>Text that is displayed if there is no data to fill a string in your data viewer.</td></tr></tbody></table>

### Layout

<table><thead><tr><th width="168.33333333333331">Property</th><th width="189">Value</th><th>Description</th><th data-hidden>Description</th></tr></thead><tbody><tr><td>X</td><td>coordinate value</td><td>Location of the top left corner of the data viewer grid on the X-axis, where the left-hand side is X=0.</td><td>Position of the upper left corner of the data viewer list on the X-axis, where the left side of the screen is X=0.</td></tr><tr><td>Y</td><td>coordinate value</td><td>Location of the top left corner of the data viewer grid on the Y-axis, where the top side is Y=0.</td><td>Position of the upper left corner of the data viewer list on the Y-axis, where the top of the screen is Y=0.</td></tr><tr><td>Height</td><td>number in pixels</td><td>Height of the data viewer grid in pixels.</td><td>The data viewer list's height is defined by a custom number of pixels.</td></tr><tr><td>Width</td><td>number in pixels</td><td>Width of the data viewer grid in pixels.</td><td>The data viewer list's width is defined by a custom number of pixels.</td></tr><tr><td>Resize Mode</td><td>Stretch</td><td>Stretches the data viewer grid to fit the dimensions of the device's screen.</td><td>Stretches the data viewer list to fit the dimensions of the device's screen.</td></tr><tr><td>Resize Mode</td><td>Float in Place</td><td>Renders the data viewer grid in the same aspect ratio as the design, regardless of the device size.</td><td>Renders the data viewer list in the same aspect ratio as the design, regardless of the device size.</td></tr></tbody></table>

## Blocks

### Block: When Data Viwer Grid Item Click

The "Item Click" event block is fired when any grid item in the data viewer is clicked. It returns  "row id" which corresponds to the unique Thunkable row ID of the item that was clicked. The row id is most useful when used with the the [data source blocks](https://docs.thunkable.com/blocks/app-features/data-sources-blocks).

![](https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-M5afbAIoaxXTKvYWILO%2F-M5baZOoXEEMh5Xs_fPH%2Fgrid_click.png?alt=media\&token=d1c34b5e-ec5b-4c01-9dce-911fb65f40e7)

### Block: In Data Viewer Grid Call Refresh Data

Refresh the data viewer grid to sync with the connected data source.

![](https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-MHGpTNkuzfTrsA7fYFG%2F-MHGx57iBPTyv01uTVlq%2Fdvg_refresh.png?alt=media\&token=4d41772f-dd9d-48c1-b70c-54cf0c0bf9f6)

### Block: Properties

Set and get [properties](#properties) of the data viewer grid.

## Related Docs

### Data Viewer Components

If the data viewer grid isn't the best layout to display your data, one of these other options may be more appropriate:&#x20;

{% content-ref url="data-viewer-list" %}
[data-viewer-list](https://docs.thunkable.com/app-design/ui-components/data-components/data-viewers/data-viewer-list)
{% endcontent-ref %}

{% content-ref url="custom-data-viewer" %}
[custom-data-viewer](https://docs.thunkable.com/app-design/ui-components/data-components/data-viewers/custom-data-viewer)
{% endcontent-ref %}

### Data Sources Blocks

To access the data sources blocks, you must first connect a data source. Then, by incorporating the data source blocks into your app, you can allow users to create, read, update, and delete data in your data source when they interact with the data viewer.&#x20;

{% content-ref url="../../../../blocks/app-features/data-sources-blocks" %}
[data-sources-blocks](https://docs.thunkable.com/blocks/app-features/data-sources-blocks)
{% endcontent-ref %}

***

{% hint style="success" %}
**Have feedback on this doc?** Please take a moment to share your feedback here: [Thunkable Docs Feedback](https://docs.google.com/forms/d/e/1FAIpQLSfCwn5L2xyla-LSLZX0DSWFcFeJ43qp-r1tELCacuVS2zduLA/viewform?usp=sf_link). Your valuable insights will help us improve and better serve you in the future.
{% endhint %}
