Customizing the Grid's Appearance > Row Height and Multiple-line Displays > Displaying a single record on multiple lines |
Normally, a record is displayed in a single row in the grid. If the grid is not wide enough to display all of the columns in the record, a horizontal scroll bar automatically appears to enable users to scroll columns in and out of view. For discussion purposes, we shall distinguish between the following:
A line in a grid is a single physical row of cells displayed in the grid. Do not confuse this with a line of text inside a grid cell; depending upon the settings of the RowHeight and WrapText properties, data in a grid cell may be displayed in multiple lines of text.
A row in a grid is used to display a single record. A row may contain multiple lines or multiple physical rows.
The MultipleLines property of the grid controls how records are displayed. The default value is 0 - Disabled, which means that a single record or row cannot span multiple lines. If necessary, the end user can operate the horizontal scroll bar to view all of the columns within a row. This is how the grid normally displays data.
However, if the MultipleLines property is set to 1 - Variable or 2 - Fixed, then a single record may span multiple lines. This feature enables the end user to view simultaneously all of the columns (fields) of a record within the width of the grid without scrolling horizontally, as in the following figure:
When the MultipleLines property is set to a value other than 0 - Disabled, the horizontal scroll bar will be hidden (if one is present), and the grid will automatically span or wrap the columns to multiple lines so that all columns will be visible within the width of the grid. If the resulting column layout is not to your liking, you can adjust it at either design time or run time by changing the widths and orders of the columns.
The difference between the settings 1 - Variable and 2 - Fixed comes into play when the width of a column or the grid itself is changed. The former setting readjusts column breaks if necessary; the latter setting preserves existing column breaks.
Note: At design time, if the ScrollBars property is set to 4 - Automatic, and the MultipleLines property is enabled, a vertical scroll bar appears even though no data is displayed. This is done so that you can take the width of the scroll bar into account when adjusting columns at design time.