Blazor | ComponentOne
Controls / DateTime Editors / DateTimePicker Overview / View Mode
In This Topic
    View Mode
    In This Topic

    DateTimePicker supports two view modes to display the calendar and the time panel at runtime. One being the side by side view, wherein the calendar and the time panel are displayed side by side when you click the drop-down button of the control and the other view mode is the switchable view, wherein the calendar is displayed at first in the default view and the time panel appears only when you click on the expanse button below the calendar.

    By default, the DateTimePicker control displays the calendar and the time panel side by side. However, you can choose to change the view mode using ViewMode property of the C1DateTimePicker class. The ViewMode property sets the view mode for the DatetimePicker control through the DateTimePickerViewMode enumeration.

     View modes in DateTimePicker control.

    The following code shows how to set the switchable view mode using the ViewMode property:

    C#
    Copy Code
    <C1DateTimePicker Value="DateTime.Today" ViewMode="@DateTimePickerViewMode.Switchable"></C1DateTimePicker>