Text
Display text and HTML, and cut long text off after a number of lines
Introduction
StellarAdmin display string properties using TextDisplay, unless an attribute on the property specifies a different display type, such as [EmailAddress].
Cutting long text off
By default, TextDisplay displays all the text in the string. To cut the text off after a number of lines, set LineClamp. The example below displays at most 2 lines of each trip's summary in the grid:
using StellarAdmin.Resources.Displays;
columns.Add(trip => trip.Summary, column =>
column.UseDisplay<TextDisplay>(text => text.LineClamp = 2));

In the grid, text with a LineClamp wraps at a readable width, instead of widening the column.
Displaying line breaks
Text that a user entered over several lines, such as in a textarea, contains line breaks. By default, TextDisplay ignores them and displays the text as a single paragraph.
To keep the line breaks in a display field, add [DataType(DataType.MultilineText)] to the property. In the grid, the line breaks are kept only when the column sets LineClamp.
Displaying HTML
StellarAdmin displays a property with [DataType(DataType.Html)] using HtmlDisplay. HtmlDisplay sanitizes the HTML, and displays it formatted.
In the grid, HtmlDisplay displays the text without formatting, cut off after 2 lines. The example below displays 4 lines instead:
columns.Add(trip => trip.Description, column =>
column.UseDisplay<HtmlDisplay>(html => html.LineClamp = 4));
