Booleans and enums
Display a bool as an icon or text, and an enum member by its name
Displaying booleans
StellarAdmin displays a bool property with BooleanDisplay, which displays a check mark for true and a cross for false.
To display text instead, or an icon and text, set Appearance. The example below displays whether a trip is published as "Live" or "Draft":
using StellarAdmin.Resources.Displays;
columns.Add(trip => trip.IsPublished, column =>
column.UseDisplay<BooleanDisplay>(flag =>
{
flag.Appearance = BooleanDisplayAppearance.Text;
flag.TrueText = "Live";
flag.FalseText = "Draft";
}));

BooleanDisplay has the following members:
| Member | Description |
|---|---|
Appearance | Determines how the value is displayed: BooleanDisplayAppearance.Icon, Text or IconAndText. The default is Icon. |
TrueText, FalseText | Specifies the text for true and false values. The defaults are "Yes" and "No". When only the icon is displayed, screen readers announce the text. |
A bool? that is null displays the column's or the field's empty text.
Displaying enums
StellarAdmin displays an enum property with EnumDisplay, which displays the value specified using the member's [Display(Name)] attribute. If the member has no [Display] attribute, EnumDisplay displays the member's name split into words, so NorthAmerica is displayed as "North America".
public enum Difficulty
{
Easy,
[Display(Name = "Moderate effort")]
Moderate,
}