LgGridWeekColumn
LgGridWeekColumn<TColumnValue> is a
LgGridView column specialized in the week of a date
value: the cell displays the week number and editing opens the
calendar in week selection mode (like
LgWeekBox).
<Columns Context="item">
<LgGridWeekColumn @bind-Value="item.DeliveryWeek" Title="#DeliveryWeek" />
</Columns>
- Namespace :
Lagoon.UI.Components - Inherits from :
LgGridDateColumn<TColumnValue>→LgGridBaseValueColumn<TColumnValue>→LgGridBaseColumn - NuGet package :
Lagoon.UI.GridView
Usage
Demo
Try this component in the Lagoon showcase.
Editable week column
<LgGridView StateId="shipments-week-column"
Items="_shipments"
EditMode="GridEditMode.Cell"
Title="#ShipmentsGridTitle">
<Columns Context="item">
<LgGridTextColumn @bind-Value="item.Reference" Title="#ShipmentReference" />
<LgGridWeekColumn @bind-Value="item.DeliveryWeek"
Title="#DeliveryWeek"
CanEdit="true" />
</Columns>
</LgGridView>
public partial class ShipmentListPage : LgPage
{
// Rows displayed by the grid: the delivery week is carried by a complete date.
private readonly List<ShipmentVm> _shipments = new();
private sealed class ShipmentVm
{
public string Reference { get; set; }
public DateTime? DeliveryWeek { get; set; }
}
}
Selection bounds
Min / Max set the bounds on selectable dates in the cell's calendar while
editing.
<LgGridView StateId="planning-week-column" Items="_slots" Title="#PlanningGridTitle">
<Columns Context="item">
<LgGridTextColumn @bind-Value="item.Team" Title="#Team" />
<LgGridWeekColumn @bind-Value="item.Week"
Title="#PlannedWeek"
Min="_minDate"
Max="_maxDate" />
</Columns>
</LgGridView>
public partial class PlanningListPage : LgPage
{
// Current planning year: restricts the calendar of cells in edit mode.
private readonly DateTime _minDate = new(2026, 1, 1);
private readonly DateTime _maxDate = new(2026, 12, 31);
private readonly List<SlotVm> _slots = new();
private sealed class SlotVm
{
public string Team { get; set; }
public DateTime? Week { get; set; }
}
}
Properties
All component [Parameter] properties, including inherited ones.
| Name | Type | Default | Declared in | Description |
|---|---|---|---|---|
Max | DateTime? | null | LgGridDateColumn | Latest selectable date while editing; later dates are disabled. |
Min | DateTime? | null | LgGridDateColumn | Earliest selectable date while editing; earlier dates are disabled. |
CellContent | RenderFragment<TColumnValue> | null | LgGridBaseValueColumn | Custom cell display template. |
CustomEditType | Type | null | LgGridBaseValueColumn | Component type used in edit mode instead of the default component. |
EditCellContent | RenderFragment<TColumnValue> | null | LgGridBaseValueColumn | Custom cell edit template. |
Value | TColumnValue | — | LgGridBaseValueColumn | Bound value (@bind-Value). |
ValueChanged | EventCallback<TColumnValue> | — | LgGridBaseValueColumn | Callback for updating the bound value. |
ValueExpression | Expression<Func<TColumnValue>> | — | LgGridBaseValueColumn | Expression identifying the bound property (carries sort, filter, and calculations). |
AllowFilter | bool | true | LgGridBaseFilterableColumn | Enables the column filter (automatically disabled without a filter expression). |
AllowHide | bool | true | LgGridBaseColumn | Allows the user to hide the column. |
AllowSort | bool | true | LgGridBaseColumn | Enables column sorting (automatically disabled without a sort expression). |
AriaLabel | string | null | LgGridBaseColumn | Value of the column's aria-label attribute. |
AriaLabelledBy | string | null | LgGridBaseColumn | Value of the column's aria-labelledby attribute. |
CalculationCssClass | string | null | LgGridBaseColumn | CSS classes for the calculation cell. |
CalculationDisplayFormat | string | null | LgGridBaseColumn | Display format of the calculation cell. |
CalculationType | DataCalculationType | None | LgGridBaseColumn | Calculation displayed in the column footer (ignored without ValueExpression). |
CanAdd | bool | true | LgGridBaseColumn | Allows input in the add row for this column. |
CanEdit | bool | true | LgGridBaseColumn | Allows editing of cells in this column. |
ColSpan | int | -1 | LgGridBaseColumn | Number of columns spanned by the cell. |
ConfirmationMessage | string | null | LgGridBaseColumn | Confirmation message before modification (cell edit mode only). |
CssClass | string | null | LgGridBaseColumn | CSS classes applied to all cells in the column. |
DefaultFilter | Filter | null | LgGridBaseFilterableColumn | Default filter applied. |
DefaultFrozen | bool | false | LgGridBaseColumn | Freezes the column by default. |
DefaultSortDirection | DataSortDirection | None | LgGridBaseColumn | Default sort direction. |
DefaultVisible | bool | true | LgGridBaseColumn | Displays the column by default. |
DefaultWidth | string | "1fr" | LgGridBaseColumn | Default column width. |
DisplayFormat | string | null | LgGridBaseColumn | Display format. The cell displays the week number of the value by default. |
Exportable | bool | true | LgGridBaseColumn | Includes the column in exports. |
ExportTitle | string | null | LgGridBaseColumn | Title used in exports (default is Title). |
ExportValueAsString | bool | false | LgGridBaseColumn | Forces the value to be exported as text. |
FilterCellContent | RenderFragment<FilterContext> | null | LgGridBaseFilterableColumn | Custom filter cell template. |
FilterDisableSelection | bool | false | LgGridBaseFilterableColumn | Hides the value selection tab in the filter editor. |
FilterExpression | LambdaExpression | null | LgGridBaseFilterableColumn | Filter expression (defaults to ValueExpression if not provided). |
FilterShowAllItems | bool? | null | LgGridBaseFilterableColumn | Offers all values in the filter, regardless of other columns' filters. |
GroupExpression | LambdaExpression | null | LgGridBaseColumn | Grouping expression. |
GroupName | string | null | LgGridBaseColumn | Name of the column header group. |
HeaderCellContent | RenderFragment | null | LgGridBaseColumn | Custom header cell template. |
HeaderCssClass | string | null | LgGridBaseColumn | CSS classes for the header cell. |
HeaderTooltip | string | null | LgGridBaseColumn | Header tooltip. |
HideContent | bool | false | LgGridBaseColumn | Hides cell content. |
Key | string | null | LgGridBaseColumn | Unique identifier for the column (derived from ValueExpression if not provided). |
LambdaExpression | LambdaExpression | null | LgGridBaseColumn | Common sort and filter expression. |
Placeholder | string | null | LgGridDateColumn | Placeholder text displayed in the cell editor. |
MaxWidth | int | 0 | LgGridBaseColumn | Maximum column width. |
MinSearchFilterCharacter | int | 0 | LgGridBaseFilterableColumn | Minimum characters to trigger search in the filter. |
MinWidth | int | 0 | LgGridBaseColumn | Minimum column width. |
OnCellClick | EventCallback<GridViewCellClickEventArgs<TItem>> | — | LgGridBaseColumn | Callback triggered on click of a cell in this column. |
Resizable | bool | true | LgGridBaseColumn | Allows column resizing. |
Title | string | null | LgGridBaseColumn | Column title. |
WeightExpression | LambdaExpression | null | LgGridBaseColumn | Weight expression for weighted average (CalculationType="Average"). |
The column receives its parent grid (LgGridView<TItem>) and render context through cascading parameters provided by LgGridView — you do not need to define them.
Methods & events
| Event | Type | Description |
|---|---|---|
OnCellClick | EventCallback<GridViewCellClickEventArgs<TItem>> | On click of a cell in the column. |
ValueChanged | EventCallback<TColumnValue> | When a cell value is modified (@bind-Value). |
Associated enumerations
Inherited enumerations are documented on the base column:
DataCalculationType and
DataSortDirection on
LgGridDateColumn, edit modes
(GridEditMode) on LgGridView.
Best practices / accessibility
- The bound value remains a complete date: the cell displays the corresponding week number. To directly manipulate a week/year pair (
WeekYear) in a form, useLgWeekBox. - The applied filter is a date filter: it applies to the complete value, not just the displayed week number.
Sheet generated from sources: API Reference — LgGridWeekColumn.
Related components
LgGridView— the data grid that hosts the column.LgGridDateColumn— base date column (day).LgGridMonthColumn— month column.LgGridYearColumn— year column.LgWeekBox— week selection field used outside the grid.