AX1475

Setting row sizes for Formatted Grids

Rows in Formatted Grid components are sized according to the row style applied to each row, and the [RowHeight] column in the data source. The row height set in the spreadsheet is ignored.

Setting row heights

Row heights in formatted grids are set as follows:

  • Each row uses the height set by the row style by default. All base row styles include a specified row height (including the default row style that is used when no base style is specified). Additionally, you can apply add-on styles to set the row height, such as row-height-18. For more information on using row styles, see Using row and column styles with Formatted Grids.

  • If a row height is set in the [RowHeight] column of the Grid data source, this row height overrides the style. So if the style sets a row height of 12 pixels, but you enter 30 pixels into the [RowHeight] column, then the row height for that row is 30 pixels.

    Generally speaking, this column is only intended for cases where you need to override the row style or set the row to a height that is not supported by the available styles. It is not necessary to enter a row height for every row.

    NOTE: If the row style includes a minimum row height, this minimum also applies to the height set in the [RowHeight] column. For example, styles that impact the font size may include a minimum row height, to ensure that the row is tall enough to show the text.

The [RowHeight] tag is included by default when you create a new Grid data source. If the tag is not present in an existing data source, you can manually add it (or use the Data Source Assistant to add it). Typically, the tag is placed on the left side of the data source, before any content columns. Row sizes can be entered as follows:

Size Description Examples

Specific size in pixels

Enter a number in pixels to set the height of the row to that number. This overrides the row height defined in the row style.

30

30px

Percent adjustment to row style

Enter a percent to adjust the height defined in the row style. For example, if the row style is 12 pixels, you can enter 200% to size the row twice the height of the row style (24 pixels).

200%

Use the row style

Enter the keyword auto or leave the cell blank to use the height defined in the row style. The keyword is intended for cases where you want to populate all cells of the [RowHeight] column for clarity, but you want some rows to use the height defined in the style.

auto

Fitting rows within the overall height of the Formatted Grid component

The overall number of rows that can be displayed in a Formatted Grid component (without scrolling) depends on the height of the component on the form canvas. The grid will behave as follows depending on whether the rows in the data source can fit into the height of the component:

  • If the overall height of all rows in the data source exceeds the height of the component, then a vertical scroll bar will be present on the grid. The user can use the scroll bar to view all rows. Alternatively, the Extended Height property for the Formatted Grid component can be used to automatically extend the height of the grid downward to accommodate the number of rows in the data source.

  • If the overall height of all rows in the data source takes up less space than the height of the component, then the grid behavior depends on the Collapse Height setting in the component properties. If disabled, then the grid remains at its configured height, and there will be blank space between the last row and the bottom edge of the component. If enabled, then the grid auto-shrinks vertically to fit the height of the row contents.

If Extended Height is enabled for a grid, then the grid dynamically extends downward to display all rows in the data source. If the height of the grid exceeds the current window, then the user can scroll the window to view the rest of the grid.

Use of Extended Height introduces some limitations to the Formatted Grid component. The option is only intended to be used for special situations that require non-scrolling grids with many rows, such as when the form needs to be printed.

  • If Extended Height is enabled, no other components can be placed below the formatted grid on the form canvas. The extended grid will not "push" the other components down; instead the other components will continue to display at their fixed location on the canvas and the formatted grid will extend underneath the other components.

    There is one exception to this behavior. If a grid with extended height is placed within a flow panel, the placement of the other components in the flow panel will adjust for the extended height. However, note that the height of the panel itself does not adjust (even if set to dock), so the Overflow property of the panel cannot be set to Hidden.

  • Fixed rows and columns are not honored when Extended Height is enabled.

  • Depending on the number of rows in the grid and the browser used to view the form, performance may be slow when viewing an extended grid online. If the Extended Height option is being used to facilitate printing, it is recommended to dynamically turn it on and off as needed to preserve online performance of the grid.

  • The Extended Height option is not compatible with the legacy form option Scale to Fit. If Scale to Fit is enabled, extended height is ignored.

For more information on using extended height when printing to PDF, see Configuring a Formatted Grid component for printing to PDF.