-
AI-powered Extensions
-
Data Grid
-
Tree List
-
Chat
-
HTML Editor
-
Form
-
-
Data Grids / Data Management
-
Data Grid
- Overview
-
Data Binding
-
Filtering
- Sorting
-
Editing
-
Grouping
-
Selection
- Focused Row
- Paging
-
Scrolling
-
Columns
- AI Assistant
-
Master-Detail
-
Data Summaries
-
Drag & Drop
-
Export to PDF
-
Export to Excel
- Appearance
-
Customization
- State Persistence
-
Adaptability
-
Keyboard Navigation
- Right-To-Left Support
-
Tree List
- Overview
-
Data Binding
-
Filtering
- Sorting
-
Editing
-
Selection
- Focused Row
- Paging
-
Columns
- Drag & Drop
- State Persistence
- Adaptability
-
Keyboard Navigation
-
Card View
-
Pivot Grid
- Overview
-
Data Binding
-
Field Management
-
Data Summaries
- Drill Down
- Filtering
-
Scrolling
-
Export to Excel
- Chart Integration
- Customization
- State Persistence
-
Filter Builder
-
-
Data Visualization
-
Charts
- Overview
-
Data Binding
-
Common Concepts
-
Axis
-
Aggregation
-
Tooltips
-
Selection
-
Customization
-
Zooming
-
Export
-
-
Area Charts
-
Bar Charts
- Bullet Charts
-
Doughnut Charts
-
Financial Charts
-
Funnel and Pyramid Charts
-
Line Charts
- Pareto Chart
-
Pie Charts
-
Point Charts
-
Polar and Radar Charts
-
Range Charts
- Sankey Chart
-
Sparkline Charts
-
Tree Map
-
Gauges
- Overview
-
Runtime update
-
Bar Gauge
-
Circular Gauge
-
Linear Gauge
-
Diagram
- Overview
-
Data Binding
-
Featured Shapes
-
Custom Shapes
-
Document Capabilities
-
User Interaction
- UI Customization
- Adaptability
-
-
Scheduling / Planning
-
Scheduler
- Overview
-
Data Binding
-
Views
-
Appointments
-
Timetable
- Editing
-
Grouping
- Virtual Scrolling
- Drag & Drop
-
Customization
- Adaptability
-
Gantt
- Overview
- Data Binding
-
Filtering
- Sorting
- Strip Lines
- Export to PDF
- Validation
-
Customization
-
-
Messaging
-
WYSIWYG Editor
-
Forms
-
Data Editors
- Overview
-
Common Concepts
-
Calendar
- Check Box
- Color Box
-
Date Box
-
Date Range Box
-
Number Box
- Radio Group
-
Range Selector
- Range Slider
- Slider
- Switch
- Text Area
- Text Box
-
Drop-Downs
- Autocomplete
-
Drop Down Box
-
Select Box
-
Tag Box
-
Lookup
-
Buttons
-
File Upload / File Management
-
File Manager
- Overview
-
File System Types
-
Customization
-
File Uploader
-
-
Popup and Notifications
-
Navigation
- Overview
- Accordion
-
Context Menu
-
Menu
- Multi View
-
Drawer
-
Tab Panel
-
Tabs
-
Toolbar
-
Stepper
- Pagination
-
List
-
Tree View
- Right-to-Left Support
-
Layout
-
Tile View
- Splitter
-
Gallery
- Scroll View
-
-
Interactive Wrappers
-
Sortable
- Resizable
-
-
Progress Indicators
-
Maps
- Overview
-
Map
-
Vector Map
-
Data Binding
- Multiple Layers
-
Markers
- Legend
-
Zooming and Panning
-
Customization
-
-
Localization
Related Demos:
Your search did not match any results.
Scheduler - Hidden Week Days
The DevExtreme Scheduler allows you to exclude specific days of the week (using the hiddenWeekDays property).
Use checkboxes in the options panel to toggle day visibility. A validation message appears if you attempt to hide all seven days (at least one day must remain visible).
Backend API
@model IEnumerable<DevExtreme.MVC.Demos.Models.Appointment>
@{
var visibleDays = new[] {
new { Index = 0, Text = "Sunday", Visible = true },
new { Index = 1, Text = "Monday", Visible = true },
new { Index = 2, Text = "Tuesday", Visible = true },
new { Index = 3, Text = "Wednesday", Visible = false },
new { Index = 4, Text = "Thursday", Visible = true },
new { Index = 5, Text = "Friday", Visible = false },
new { Index = 6, Text = "Saturday", Visible = true }
};
}
<div class="hidden-days-demo">
<div class="scheduler-container">
@(Html.DevExtreme().Scheduler()
.ID("scheduler")
.DataSource(Model, "AppointmentId")
.TimeZone("America/Los_Angeles")
.Views(views => {
views.Add().Type(SchedulerViewType.Week);
views.Add().Type(SchedulerViewType.WorkWeek);
views.Add().Type(SchedulerViewType.Month);
views.Add().Type(SchedulerViewType.TimelineWeek);
views.Add().Type(SchedulerViewType.Agenda);
})
.CurrentView(SchedulerViewType.Week)
.CurrentDate(new DateTime(2021, 4, 26))
.StartDayHour(9)
.Height(730)
.TextExpr("Text")
.StartDateExpr("StartDate")
.EndDateExpr("EndDate")
.AllDayExpr("AllDay")
.HiddenWeekDays(new[] { DayOfWeek.Wednesday, DayOfWeek.Friday })
)
</div>
<div class="options">
<div class="caption">Visible Week Days</div>
@foreach(var day in visibleDays) {
<div class="option" data-day-index="@day.Index">
@(Html.DevExtreme().CheckBox()
.Value(day.Visible)
.Text(day.Text)
.OnValueChanged("onDayToggle")
)
</div>
}
<div class="validation-message">
The hiddenWeekDays option cannot hide all days of the week. At least one day must remain visible.
</div>
</div>
</div>
<script>
const allDays = [0, 1, 2, 3, 4, 5, 6];
let visibleDays = [0, 1, 2, 4, 6];
function getScheduler() {
return $("#scheduler").dxScheduler("instance");
}
function applyHiddenWeekDays() {
const hiddenWeekDays = allDays.filter((day) => visibleDays.indexOf(day) === -1);
$(".hidden-days-demo").toggleClass("is-invalid", visibleDays.length === 0);
getScheduler().option("hiddenWeekDays", hiddenWeekDays);
}
function onDayToggle(e) {
const dayIndex = Number($(e.element).closest(".option").data("dayIndex"));
const visibleDayIndex = visibleDays.indexOf(dayIndex);
if(e.value && visibleDayIndex === -1) {
visibleDays.push(dayIndex);
visibleDays.sort((left, right) => left - right);
}
if(!e.value && visibleDayIndex > -1) {
visibleDays.splice(visibleDayIndex, 1);
}
applyHiddenWeekDays();
}
$(function() {
applyHiddenWeekDays();
});
</script>
using DevExtreme.MVC.Demos.Models.SampleData;
using DevExtreme.MVC.Demos.Models.Scheduler.ResolveTimeConflicts;
using DevExtreme.MVC.Demos.ViewModels;
using System.Web.Mvc;
namespace DevExtreme.MVC.Demos.Controllers {
public class SchedulerController : Controller {
public ActionResult HiddenDays() {
return View(SampleData.Appointments);
}
}
}
.hidden-days-demo {
display: flex;
gap: 20px;
}
.hidden-days-demo .scheduler-container {
flex: 1;
min-width: 0;
}
.hidden-days-demo .options {
display: flex;
flex-direction: column;
flex-shrink: 0;
width: 220px;
box-sizing: border-box;
padding: 20px;
background-color: rgb(191 191 191 / 15%);
gap: 12px;
}
.hidden-days-demo .caption {
font-weight: 500;
font-size: 18px;
}
.hidden-days-demo .option {
display: flex;
flex-direction: column;
}
.hidden-days-demo .validation-message {
display: none;
margin-top: 8px;
padding: 10px 12px;
background: #fdf3f4;
border-left: 3px solid #c50f1f;
border-radius: 4px;
color: #c50f1f;
font-size: 13px;
line-height: 1.4;
}
.hidden-days-demo.is-invalid .validation-message {
display: block;
}
.hidden-days-demo.is-invalid .option .dx-checkbox-icon {
border-color: #c50f1f;
}
.hidden-days-demo.is-invalid .dx-scheduler-work-space {
opacity: 0.4;
pointer-events: none;
}
To hide specific days of the week, assign an array of day indexes to the hiddenWeekDays property. Index values follow the JavaScript date.getDay() convention:
0- Sunday1- Monday2- Tuesday3- Wednesday4- Thursday5- Friday6- Saturday
The property works across multiple view types. To hide days of the week from a specific view, use the same property within the view configuration object.