ValueChange event seems broken
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>
<DatePickerEvents ValueChange="DateChanged"></DatePickerEvents>
</EjsDatePicker>
@code {
protected async Task DateChanged(Syncfusion.EJ2.Blazor.Calendars.ChangedEventArgs<DateTime?> args)
{
if (args.IsInteracted)
{
// do something here
}
}
{
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?
SIGN IN To post a reply.
3 Replies
SD
Saranya Dhayalan
Syncfusion Team
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
MA
Matthew
December 18, 2019 09:52 AM UTC
Hi,
Thanks again for you help, adding in the TValue parameter has done the trick.
SD
Saranya Dhayalan
Syncfusion Team
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
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
-
MA Matthew
- Dec 17, 2019 09:11 PM UTC
- Dec 18, 2019 10:08 AM UTC