Skip to main content
All docs
V24.2

DxDateEditSettings.WeekNumberRule Property

Specifies the first week of the year.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

Declaration

[DefaultValue(WeekNumberRule.Default)]
[Parameter]
public WeekNumberRule WeekNumberRule { get; set; }

Property Value

Type Default Description
WeekNumberRule Default

An enumeration value.

Available values:

Name Description
Default

Specified by the system’s CalendarWeekRule property.

FirstDay

The week that contains the 1st of January.

FirstFullWeek

The first full week.

FirstFourDayWeek

The first week that has a majority (4 or more) of its days in January.

Remarks

Date editor displays week numbers on the left side of the drop-down calendar. The WeekNumberRule property defines the first week of the year.

The following code snippet sets this property to FirstFullWeek.

<DxGrid Data="@employees" EditMode="GridEditMode.EditRow">
    <Columns>
        <DxGridCommandColumn />
        <DxGridDataColumn FieldName="FirstName" />
        <DxGridDataColumn FieldName="LastName" />
        <DxGridDataColumn FieldName="BirthDate" />
        <DxGridDataColumn FieldName="HireDate" >
             <EditSettings>
                <DxDateEditSettings WeekNumberRule="WeekNumberRule.FirstFullWeek"  />
            </EditSettings>
        </DxGridDataColumn>>
        <DxGridDataColumn FieldName="Email" />
    </Columns>
</DxGrid>

@code {
    Employee[]? employees;
    protected override async Task OnInitializedAsync() {
        employees = await EmployeeData.GetData();
    }
}

Grid - WeekNumberRule

To change the first week of the year at runtime, use the IDateEditSettings.WeekNumberRule property instead.

Implements

See Also