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

On Change Binding and Disable user entry

Thread ID:

Created:

Updated:

Platform:

Replies:

146616 Aug 10,2019 04:14 PM UTC Aug 12,2019 11:20 AM UTC Blazor 1
loading
Tags: DatePicker
Ryan Richards
Asked On August 10, 2019 04:14 PM UTC

Hello,
I connected the OnChange event on the DatePicker but it is not firing. Do you have an example of this. Just need to get a call back when the user selects a new date.
I also want to disable the ability of the user to type in a date. I want to force them to open the datepicker to select a date.
Thanks,
Ryan

Berly Christopher [Syncfusion]
Replied On August 12, 2019 11:20 AM UTC

Hi Ryan, 
  
  
Greetings from Syncfusion support. 
  
  
We would like to inform you that bind the change event name as “ValueChange” and we suggest you to use our public API “AllowEdit” as “false” to disable typing in the DatePicker input and select the date only from the DatePicker popup as mentioned in the below code example.  
  
[index.razor] 
  
<EjsDatePicker Value="@DateValue" ValueChange="@onChange" AllowEdit="false"></EjsDatePicker> 
<p>DatePicker Value is: @DateValue</p> 
@code { 
  
    public DateTime? DateValue { get; set; } = DateTime.Now; 
  
  
    private void onChange(Syncfusion.EJ2.Blazor.Calendars.ChangedEventArgs args) 
    { 
        DateValue = args.Value; 
    } 
} 
  
  
Please find the sample from the below link. 
  
  
  
To know more about DatePicker component, please refer the below documentation link.  
  
  
  
Regards, 
Berly B.C 


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