# Multiple Line Data Display

## Content

A record is displayed as a single row in the grid. If the grid is not wide enough to display all columns, a horizontal scroll bar automatically appears, allowing users to scroll through the columns. In the grid, a **row** represents a single record and may consist of multiple lines or physical rows. A **line** in a grid refers to a single physical row of cells displayed and is not the same as a line of text within a cell.

Data within a line can span across multiple lines of text using the [RowHeight](/componentone/docs/win/online-truedbgrid/) and [Wrap](/componentone/api/win/online-truedbgrid/dotnet-api/C1.Win.TrueDBGrid.10/C1.Win.TrueDBGrid.Style.Wrap.html) properties. The **RowHeight** property adjusts the height of the cell or line, not the row. The **Wrap** property accepts values from [TextWrapping](/componentone/api/win/online-truedbgrid/dotnet-api/C1.Win.TrueDBGrid.10/C1.Win.TrueDBGrid.TextWrapping.html) enumeration.

![Wrapping text](https://cdn.mescius.io/document-site-files/images/a1b176e5-6638-4b1f-a786-e41a817558bb/images/truedbgridtextwrap.png)

The following example code illustrates **RowHeight** and **Wrap** properties:

```csharp
c1TruedbGrid1.RowHeight = 30;
c1TruedbGrid1.Style.Wrap = C1.Win.TrueDBGrid.TextWrapping.Wrap;
```

In addition to Wrap property, the [TrueDbGrid](/componentone/api/win/online-truedbgrid/dotnet-api/C1.Win.TrueDBGrid.10/C1.Win.TrueDBGrid.html) class provides two other ways to display data in multiple lines: MultipleLines and MultipleLinesFixed. Setting the [DataView](/componentone/api/win/online-truedbgrid/dotnet-api/C1.Win.TrueDBGrid.10/C1.Win.TrueDBGrid.C1TrueDBGrid.DataView.html) property to [DataViewEnum.MultipleLines](/componentone/docs/win/online-truedbgrid/) displays each field of data in the dataset within the available grid area. If the dataset contains more fields than can fit in the grid area, a single record will extend across multiple lines. This allows the users to view all the columns (fields) of a record simultaneously within the grid's width, eliminating the need for horizontal scrolling:

![](https://cdn.mescius.io/document-site-files/images/a1b176e5-6638-4b1f-a786-e41a817558bb/images/multilines-view.png)

When DataView property is set to [DataViewEnum.MultipleLinesFixed](/componentone/api/win/online-truedbgrid/dotnet-api/C1.Win.TrueDBGrid.10/C1.Win.TrueDBGrid.DataViewEnum.html), the number of subrows (lines) per record depends on value specified in the [LinesPerRow](/componentone/api/win/online-truedbgrid/dotnet-api/C1.Win.TrueDBGrid.10/C1.Win.TrueDBGrid.C1TrueDBGrid.LinesPerRow.html) property. For example, the image below shows the grid when the **DataView** property is set to **MultipleLinesFixed** and **LinesPerRow** property is set to 2.

![Multipple line fixed](https://cdn.mescius.io/document-site-files/images/a1b176e5-6638-4b1f-a786-e41a817558bb/images/multi-lines-fixed.png)

The below code illustrates **MultipleLinesFixed** and **LinesPerRow** properties:

```csharp
c1TruedbGrid1.DataView = C1.Win.TrueDBGrid.DataViewEnum.MultipleLinesFixed;
c1TruedbGrid1.LinesPerRow = 2;
```

>type=note
> **Note**: In .NET Framework, you can set the **DataView** type and **LinesPerRow** either through code or Tasks menu.

Further, you can adjust column layout at design time or run time by modifying the width and order of the columns. When you change a column's width the grid will adjust the size of the column by reallocating space from other other columns on the same line. Unlike previous versions of the grid, the columns will not wrap to a new line when resized. Additionally, when DataView is set to MultipleLinesFixed, resizing columns beyond the viewable area, automatically adds a horizontal scrollbar to the grid.

To change the order of columns while in MultipleLine view, click and drag the column header to the new position. A red arrow should indicate where the column is to be placed. After dropping the column, the grid will reposition the columns accordingly.

## Impact of Multi-line Mode

Existing row-related properties, methods, and events work as defined, although some impact behavior in Multi-line mode. For example:

* The [VisibleRows](/componentone/docs/win/online-truedbgrid/) property returns the number of visible rows or records displayed on the grid, not the number of visible lines. If a row spans two lines, and the [VisibleRows](/componentone/docs/win/online-truedbgrid/) property returns 5, then there are 10 visible lines displayed on the grid.
* The [RowTop](/componentone/docs/win/online-truedbgrid/) method accepts a row number argument ranging from 0 to [VisibleRows](/componentone/docs/win/online-truedbgrid/) \- 1 and returns the Y\-coordinate position of the top of the specified row number\. For example\, if a row spans two lines\, calling RowTop\(2\) returns the Y\-coordinate position of the top of the third row\, which corresponds to the fifth displayed line\.
* The [RowResize](/componentone/docs/win/online-truedbgrid/) event is triggered when a row is resized by the user at run time. Note that only row divider boundaries are displayed in the record selector column, so users can resize rows but not individual lines.

>type=note
> **Note**: If the RowDivider style property is changed, all dividers between rows and lines are adopt the same style.