Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DxRangeSelectorScale.WorkdaysOnly Property

Specifies whether the Range Selector displays only workdays on the scale.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[DefaultValue(false)]
[Parameter]
public bool WorkdaysOnly { get; set; }

#Property Value

Type Default Description
Boolean false

true to display only workdays; false to display the whole week.

#Remarks

Set the WordaysOnly property to true to display only workdays on the Range Selector’s scale. You can use the WorkDates or Holidays property to specify which days the component displays as workdays or holidays, respectively.

Note

The WorkdaysOnly property is in effect when the DxRangeSelectorScale.ValueType property value is DateTime.

The following code snippet marks specific weekend dates as workdays and work week dates as holidays and uses the checkbox to display only workdays on the scale:

Razor
<DxCheckBox @bind-Checked="showWorkDays" T="bool">Show Workdays Only</DxCheckBox>
<DxRangeSelector Width="1100px"
                 Height="200px"
                 SelectedRangeStartValue="@(new DateTime(2024, 2, 1))"
                 SelectedRangeEndValue="@(new DateTime(2024, 2, 14))">
    <DxRangeSelectorScale StartValue="@(new DateTime(2024, 1, 1))"
                          EndValue="@(new DateTime(2024, 3, 1))"
                          TickInterval="ChartAxisInterval.Day"
                          MinRange="ChartAxisInterval.Week"
                          MaxRange="ChartAxisInterval.Month"
                          WorkdaysOnly="showWorkDays"
                          WorkDates="@(new object[]{new DateTime(2024, 2, 3),
                                                    new DateTime(2024, 2, 10)})"
                          Holidays="@(new object[]{new DateTime(2024, 1, 4),
                                                   new DateTime(2024, 1, 5),
                                                   new DateTime(2024, 1, 12)})"
                          ValueType="ChartAxisDataType.DateTime">
        <DxRangeSelectorScaleMarker>
            <DxRangeSelectorScaleMarkerLabel>
                <DxTextFormatSettings Type="TextFormat.MonthAndYear" />
            </DxRangeSelectorScaleMarkerLabel>
        </DxRangeSelectorScaleMarker>
    </DxRangeSelectorScale>
    <DxRangeSelectorSliderMarker>
        <DxTextFormatSettings Type="TextFormat.MonthAndDay" />
    </DxRangeSelectorSliderMarker>
</DxRangeSelector>

@code {
    bool showWorkDays = false;
}
See Also