SfDateSelector Styling and 'Accepted' Event Handling
Thank you for using Syncfusion products.
Query #1:is there a way to handle the accept/checkmark button tapped event?
We have prepared a sample and tried to meet your requirement. In the sample, we have retrieved the buttons from SfDateSelector using VisualTreeHelper and hooked the Tapped events.
Query #2: Can I style the selector so that it fills the entire screen?
Yes. You can style the selector to fill entire screen by setting the DropDownHeight property in SfDatePicker and Width of SfDateSelector in SelectorStyle property. Please download the sample from following link,
Sample: DateSelector.zip
Please let us know whether the provided sample meets your requirement or not.
Regards,
Jessie
We have prepared a sample and tried to meet your requirement. In the sample, we have retrieved the buttons from SfDateSelector using VisualTreeHelper and hooked the Tapped events.
Great. That definitely does the job. Interesting phenomenon though: every time you close the selector using one of the buttons, the number of times the corresponding handler fires increases -- once the first time, twice the second time, and so on. Not a severe issue as I don't expect the user to change the date many times at once.
Yes. You can style the selector to fill entire screen by setting the DropDownHeight property in SfDatePicker and Width of SfDateSelector in SelectorStyle property. Please download the sample from following link,
OK. This requires setting the properties in code behind after determining the screen dimensions, correct? DropDownHeight is straightforward. How about setting the selector Width?
Thanks and regards,
-Jürgen
Thank you for the update.
Query 1: every time you close the selector using one of the buttons, the number of times the corresponding handler fires increases
While checking the issue we found that the Tapped event is hooked every time the Selector is opened. We have modified the sample to resolve this. In the sample, we have defined a temporary bool variable "handled" and hooked the event only once based on the handled variable.
Query 2: This requires setting the properties in code behind after determining the screen dimensions, correct? How about setting the selector Width?
In the previous update, we had set the Width of the SfDateSelector in the SelectorStyle property to define in Xaml. We can also set the width in code-behind by retrieving the Selector from SfDatePicker and assigning the width. We have modified the sample to demonstrate the same. In the sample we have set the Width of the Selector in the dropdownpopup_Opened event.
Please find the sample in the below link.
Sample: DateSelector.zip
Please let us know if you require further assistance on this.
Regards,
Bharadhi K
Thank you for your suggestions.
We could find that you have already created a incident with following suggestions. We request to follow up with the incident for further updates.
Please let us know if you have any questions.
Regards,
Jessie
- 7 Replies
- 3 Participants
-
JÜ Jürgen
- Apr 19, 2015 08:56 AM UTC
- Apr 24, 2015 12:58 PM UTC