We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Binding to property is failing

Thread ID:

Created:

Updated:

Platform:

Replies:

149966 Dec 16,2019 02:00 PM UTC Dec 17,2019 06:08 AM UTC Blazor 1
loading
Tags: DatePicker
Waleed
Asked On December 16, 2019 02:00 PM UTC

Hi, I have this problem with DatePicker component, whenever I try to bind to value of DateTime of a type it gives me error

here is my definition :

   <td class="text-left"><EjsDatePicker Readonly="true"  @bind-Value="@myEntity.DocDate"  /></td>

and

public DTO myEntity { get; set; }

and   
public DateTime DocDate { get; set; } = DateTime.Today;

the error is :

Error    CS1503    Argument 2: cannot convert from 'Microsoft.AspNetCore.Components.EventCallback<System.DateTime>' to 'Microsoft.AspNetCore.Components.EventCallback'


Saranya Dhayalan [Syncfusion]
Replied On December 17, 2019 06:08 AM UTC

Hi Waleed, 
 
Thank you for contacting Syncfusion support, 
 
The default value in our Datepicker Value property is Null. Default DateTime value is “1/1/0001 12:00:00 AM”. It’s set to the invalid date for Datepicker component. So, you need to specify nullable type of DateTimeIn our volume-4 release, we will provide support for the generic type (TValue). Please find the below code snippet. 
@using Syncfusion.EJ2.Blazor.Calendars 
 
    <td class="text-left"><EjsDatePicker Readonly="true" @bind-Value="@myEntity.DocDate" /></td> 
 
 
@code { 
       
    public DateTime? DocDate { get; set; } = DateTime.Today; 
      
} 
 
Please find the below documentation link: 
 
Could you please check the above code snippet and get back to us if you need further assistance on this? 
 
Regards, 
Saranya D 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon