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

ValueChange event seems broken

Thread ID:

Created:

Updated:

Platform:

Replies:

150011 Dec 17,2019 09:11 PM UTC Dec 18,2019 10:08 AM UTC Blazor 3
loading
Tags: DatePicker
Matthew
Asked On December 17, 2019 09:11 PM UTC

Hi,

I can see from the latest release that the EjsDatePicker has undergone a few changes (along with DropDownList and a few other controls - all issue swith which I have fixed), it's the ValueChange event which is now in the DatePickerEvents section of the control, and no longer in the main element which is causing me problems.

Anyway, as well as introducing TValue for templating and needing this on the ValueChange event, it does not seem to compile for me. (I have updated to the latest version of everything from .net core SDK and syncfusion packages.

Here is my code:
<EjsDatePicker TValue="DateTime?" Placeholder="Start Date" FloatLabelType="FloatLabelType.Always" Format="dd/MM/yyyy" AllowEdit="false" Readonly="false" Value="@DateTime.Now.Date">
    <DatePickerEvents ValueChange="DateChanged"></DatePickerEvents>
</EjsDatePicker>
@code {
    protected async Task DateChanged(Syncfusion.EJ2.Blazor.Calendars.ChangedEventArgs<DateTime?> args)
    {
        if (args.IsInteracted)
        {
            // do something here
        }
    }
}

When I try to compile I get "Argument 2: cannot convert from 'method group' to 'EventCallback' " on the <DatePickerEvents> line in the code.

Any Ideas what I am doing wrong?



Saranya Dhayalan [Syncfusion]
Replied On December 18, 2019 04:56 AM UTC

Hi Matthew, 
 
Thank you for contacting Syncfusion support 
 
We have checked your reported issue, cause of the issue is you need to add the TValue to DatePickerEvents. Please find the below code snippet: 
 
@using Syncfusion.EJ2.Blazor.Calendars 
@using Syncfusion.EJ2.Blazor.Inputs 
 
<EjsDatePicker TValue="DateTime?" Placeholder="Start Date" FloatLabelType="FloatLabelType.Always" Format="dd/MM/yyyy" AllowEdit="false" Readonly="false" Value="@DateTime.Now.Date"> 
    <DatePickerEvents TValue="DateTime?" ValueChange="DateChanged"></DatePickerEvents> 
</EjsDatePicker> 
@code { 
    protected async Task DateChanged(Syncfusion.EJ2.Blazor.Calendars.ChangedEventArgs<DateTime?> args) 
    { 
        if (args.IsInteracted) 
        { 
            // do something here 
        } 
    } 
} 
 
Please find the release notes for the DatePicker ValueChange event 
 
 
Could you please check the above code snippet and get back to us if you need further assistance on this? 
 
Regards, 
Saranya D 


Matthew
Replied On December 18, 2019 09:52 AM UTC

Hi,

Thanks again for you help, adding in the TValue parameter has done the trick.


Saranya Dhayalan [Syncfusion]
Replied On December 18, 2019 10:08 AM UTC

Hi Matthew 
 
Most Welcome.  
 
Please let us know, if you need any 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