Skip to main content

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​

ShipmentListPage.razor
<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>
ShipmentListPage.razor.cs
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.

PlanningListPage.razor
<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>
PlanningListPage.razor.cs
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.

NameTypeDefaultDeclared inDescription
MaxDateTime?nullLgGridDateColumnLatest selectable date while editing; later dates are disabled.
MinDateTime?nullLgGridDateColumnEarliest selectable date while editing; earlier dates are disabled.
CellContentRenderFragment<TColumnValue>nullLgGridBaseValueColumnCustom cell display template.
CustomEditTypeTypenullLgGridBaseValueColumnComponent type used in edit mode instead of the default component.
EditCellContentRenderFragment<TColumnValue>nullLgGridBaseValueColumnCustom cell edit template.
ValueTColumnValue—LgGridBaseValueColumnBound value (@bind-Value).
ValueChangedEventCallback<TColumnValue>—LgGridBaseValueColumnCallback for updating the bound value.
ValueExpressionExpression<Func<TColumnValue>>—LgGridBaseValueColumnExpression identifying the bound property (carries sort, filter, and calculations).
AllowFilterbooltrueLgGridBaseFilterableColumnEnables the column filter (automatically disabled without a filter expression).
AllowHidebooltrueLgGridBaseColumnAllows the user to hide the column.
AllowSortbooltrueLgGridBaseColumnEnables column sorting (automatically disabled without a sort expression).
AriaLabelstringnullLgGridBaseColumnValue of the column's aria-label attribute.
AriaLabelledBystringnullLgGridBaseColumnValue of the column's aria-labelledby attribute.
CalculationCssClassstringnullLgGridBaseColumnCSS classes for the calculation cell.
CalculationDisplayFormatstringnullLgGridBaseColumnDisplay format of the calculation cell.
CalculationTypeDataCalculationTypeNoneLgGridBaseColumnCalculation displayed in the column footer (ignored without ValueExpression).
CanAddbooltrueLgGridBaseColumnAllows input in the add row for this column.
CanEditbooltrueLgGridBaseColumnAllows editing of cells in this column.
ColSpanint-1LgGridBaseColumnNumber of columns spanned by the cell.
ConfirmationMessagestringnullLgGridBaseColumnConfirmation message before modification (cell edit mode only).
CssClassstringnullLgGridBaseColumnCSS classes applied to all cells in the column.
DefaultFilterFilternullLgGridBaseFilterableColumnDefault filter applied.
DefaultFrozenboolfalseLgGridBaseColumnFreezes the column by default.
DefaultSortDirectionDataSortDirectionNoneLgGridBaseColumnDefault sort direction.
DefaultVisiblebooltrueLgGridBaseColumnDisplays the column by default.
DefaultWidthstring"1fr"LgGridBaseColumnDefault column width.
DisplayFormatstringnullLgGridBaseColumnDisplay format. The cell displays the week number of the value by default.
ExportablebooltrueLgGridBaseColumnIncludes the column in exports.
ExportTitlestringnullLgGridBaseColumnTitle used in exports (default is Title).
ExportValueAsStringboolfalseLgGridBaseColumnForces the value to be exported as text.
FilterCellContentRenderFragment<FilterContext>nullLgGridBaseFilterableColumnCustom filter cell template.
FilterDisableSelectionboolfalseLgGridBaseFilterableColumnHides the value selection tab in the filter editor.
FilterExpressionLambdaExpressionnullLgGridBaseFilterableColumnFilter expression (defaults to ValueExpression if not provided).
FilterShowAllItemsbool?nullLgGridBaseFilterableColumnOffers all values in the filter, regardless of other columns' filters.
GroupExpressionLambdaExpressionnullLgGridBaseColumnGrouping expression.
GroupNamestringnullLgGridBaseColumnName of the column header group.
HeaderCellContentRenderFragmentnullLgGridBaseColumnCustom header cell template.
HeaderCssClassstringnullLgGridBaseColumnCSS classes for the header cell.
HeaderTooltipstringnullLgGridBaseColumnHeader tooltip.
HideContentboolfalseLgGridBaseColumnHides cell content.
KeystringnullLgGridBaseColumnUnique identifier for the column (derived from ValueExpression if not provided).
LambdaExpressionLambdaExpressionnullLgGridBaseColumnCommon sort and filter expression.
PlaceholderstringnullLgGridDateColumnPlaceholder text displayed in the cell editor.
MaxWidthint0LgGridBaseColumnMaximum column width.
MinSearchFilterCharacterint0LgGridBaseFilterableColumnMinimum characters to trigger search in the filter.
MinWidthint0LgGridBaseColumnMinimum column width.
OnCellClickEventCallback<GridViewCellClickEventArgs<TItem>>—LgGridBaseColumnCallback triggered on click of a cell in this column.
ResizablebooltrueLgGridBaseColumnAllows column resizing.
TitlestringnullLgGridBaseColumnColumn title.
WeightExpressionLambdaExpressionnullLgGridBaseColumnWeight expression for weighted average (CalculationType="Average").
Cascading parameters

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​

EventTypeDescription
OnCellClickEventCallback<GridViewCellClickEventArgs<TItem>>On click of a cell in the column.
ValueChangedEventCallback<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, use LgWeekBox.
  • The applied filter is a date filter: it applies to the complete value, not just the displayed week number.
Complete reference

Sheet generated from sources: API Reference — LgGridWeekColumn.