LgGridBooleanColumn
LgGridBooleanColumn<TColumnValue> displays a boolean value as a checkbox. For export, use DisplayFormat if you want to customize the text rendering.
<Columns Context="item">
<LgGridBooleanColumn @bind-Value="item.IsActive" Title="#Active" />
</Columns>
- NuGet package:
Lagoon.UI.GridView
Common parameters are documented in LgGridBaseColumn. This column adds no specific parameters.
Usage
Demonstration
Try this component in the Lagoon showcase.
Standard boolean and custom rendering
GridBooleanColumnPage.razor
@inherits LgPage
<LgGridView StateId="orders-boolean-column"
Items="_orders"
EditMode="GridEditMode.Cell"
Title="#OrdersGridTitle">
<Columns Context="item">
<LgGridTextColumn @bind-Value="item.Number" Title="#OrderNumber" />
<LgGridBooleanColumn @bind-Value="item.IsValidated" Title="#Validated" CanEdit="true" />
<LgGridBooleanColumn @bind-Value="item.IsLocked" Title="#Locked" AllowFilter="false">
<CellContent Context="value">
@if (value)
{
<LgIcon IconName="@IconNames.All.LockFill" />
}
</CellContent>
</LgGridBooleanColumn>
</Columns>
</LgGridView>
The boolean filter offers three states: true, false, or indeterminate to return to all values.
Filter
Boolean filter.
Associated enumerations
Enumerations inherited from LgGridView used in the examples (GridEditMode) are documented in LgGridView.
Complete reference
API sheet generated from the sources: API Reference — LgGridBooleanColumn.
Related components
LgGridView— the data grid that hosts the column.LgGridTextColumn— base column and inherited common parameters.LgGridSelectionColumn— row selection checkboxes.