ComponentOne DateTimeEditors for UWP
C1DateTime Picker Help / C1DateTimePicker Task-Based Help / Selecting the Edit Mode
In This Topic
    Selecting the Edit Mode
    In This Topic

    By default, the C1DateTimePicker control shows both the date and time pickers, but you may also choose to show only the date picker or only the time picker. In this topic, you will learn how to change the editor mode in the designer, in XAML, and in code.

    In the Designer

    To change the edit mode, complete the following steps:

    1. Click the C1DateTimePicker control once to select it.
    2. In the Properties window, click the C1DateTimePicker.EditMode drop-down arrow and select a mode from the list. For this example, select Date.

    In XAML

    To change the edit mode, place EditMode="Date" to the <DateTimeEditors:C1DateTimePicker>tag so that the markup resembles the following:

    Markup
    Copy Code
    <DateTimeEditors:C1DateTimePicker EditMode="Date">
    

    In Code

    To change the edit mode, complete the following steps:

    1. Open the MainPage.xaml.cs page.
    2. Import the following namespace:
    Visual Basic
    Copy Code
    Imports C1.XAML.DateTimeEditors
    

    C#
    Copy Code
    using C1.XAML.DateTimeEditors;
    
    1. Place the following code beneath the C1DateTimePicker_Loaded event:
    Visual Basic
    Copy Code
    C1DateTimePicker1.EditMode = C1DateTimePickerEditMode.Date
    

    C#
    Copy Code
    c1DateTimePicker1.EditMode = C1DateTimePickerEditMode.Date;
    
    1. Run the project.

    This Topic Illustrates the Following:

    In this topic, you set the C1DateTimePicker.EditMode to Date, which removes the time picker form the C1DateTimePicker control. The result of this topic will resemble the following image:

     

    See Also