How to get selected date in Date Picker with SfPicker?

I knew there is a SelectionChanged event can handle this, but for the date picker implementation (follow this), it will trigger everytime when I scroll the date, how about just get the values after click the 'OK' button?

thanks!

3 Replies

DV Divya Venkatesan Syncfusion Team February 11, 2020 11:15 AM UTC

Hi Winson, 
 
Greetings from Syncfusion. 
 
You can get the selected values from the Selection Changed event arguments in OKButtonClicked event as shown in the below code snippet. 
 
Code snippet [C#]: 
 
… 
 
picker.OkButtonClicked += picker_OkButtonClicked; 
…. 
 
private void picker_OkButtonClicked(object sender, Syncfusion.SfPicker.XForms.SelectionChangedEventArgs e) 
          var selectedItem = e.NewValue         //get the selectedItem from this. 
 
 
Please refer the below UG link for this. 
 
Please get back us, if you have any concern. 
 
Regards 
Divya Venkatesan 



WI Winson February 11, 2020 11:22 AM UTC

oh, I see, thank you so much!!


DV Divya Venkatesan Syncfusion Team February 11, 2020 12:08 PM UTC

Hi Winson, 
 
Thanks for the update.  Please let us know if you need any further assistance. 
 
Regards, 
Divya Venkatesan 


Loader.
Up arrow icon