This is a migrated thread and some comments may be shown as answers.

Nullable Datepicker

1 Answer 523 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
Nga
Top achievements
Rank 1
Nga asked on 22 Feb 2013, 03:09 AM
Hi,

I have editable grid which opens a popup when editing, this is opening a template page.

In this template page I have a kendo datepicker


<div class="editor-label">
    @Html.LabelFor(model => model.DateInvoiced)
</div>
<div class="editor-field">
    @(Html.Kendo().DatePickerFor(model => model.DateInvoiced))
    @Html.ValidationMessageFor(model => model.DateInvoiced)
</div>

It is binding to a viewmodel where the DateInvoiced is a nullable datetime.
When we add a record we don't want to provide this value yet, but when we hit the save button, the kendo datepicker is asking us to provide the value and is making this required.

The model is nullable and does not have required attribute.

        [Display(Name = "Received")]
        public Nullable<DateTime> DateInvoiced { get; set; }

How do we make the datepicker allow blank value?


1 Answer, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 25 Feb 2013, 11:50 AM
Hi Nga,

I am not able to reproduce such behavior. Could you please checked the attached project and see if I missed something? The BirthDate property is nullable and not required on my side.

Kind Regards,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Date/Time Pickers
Asked by
Nga
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Share this question
or