How to clear the selected range of SFDateRangePicker

How do you clear the selected values of the date range picker?


I've used the @bind-StartDate and @bind-EndDate​ attributes for two-way binding, but setting the variables to null and calling StateHasChanged​ does not clear the control like the clear button does inside the control.


I've got an external button that needs to clear the control, and I can find a method to clear the values.



3 Replies

BC Berly Christopher Syncfusion Team August 25, 2021 07:33 AM UTC

Hi Marcel, 
  
Greetings from Syncfusion support. 
  
We have checked the DateRangePicker component by clear the start and end date in the external button and it’s working fine. So, please share the issue reproducing procedure along with code example and Syncfusion NuGet version that will help us to check and proceed further from our end. 
  
For your convenience, we have prepared the sample and attached it below. 
  
Regards, 
Berly B.C 



MA Marcel August 25, 2021 09:10 AM UTC

Thanks for the reply. I was actually using an older version of the NuGet package. I've updated to the latest version and it is now working. (Will do this in the future before posting!)




BC Berly Christopher Syncfusion Team August 26, 2021 06:10 AM UTC

Hi Marcel, 
  
Most welcome. Please let us know if you need further assistance on this. 
  
Regards, 
Berly B.C 


Loader.
Up arrow icon