wpf - How to auto-close a telerik RadDateTimePicker on selected date -


the control declared follows :

 <telerik:raddatetimepicker inputmode="datetimepicker"                             istabstop="false"                             height="36"                             focusable="false"                             validation.errortemplate="{x:null}"                             selectiononfocus="selectall"                             x:name="outwardstartdate"                             borderthickness="2,2,2,2"                             selectedvalue="{binding outwarddeparturedate, mode=twoway, validatesondataerrors=true,                                                                      notifyonvalidationerror=true}" > 

i've failed find xaml attributes in order auto-close control when date selected. i've stumble upon this post on official website, question dated 5 years ago , none of current answers solved issue.

you can hook selectionchanged event.

in xaml follows :

<telerik:raddatetimepicker inputmode="datetimepicker"                            selectionchanged="raddatetimepicker_selectionchanged"                            istabstop="false"                            height="36"                            focusable="false"                            validation.errortemplate="{x:null}"                            selectiononfocus="selectall"                            x:name="outwardstartdate"                            borderthickness="2,2,2,2"                            selectedvalue="{binding outwarddeparturedate,                                                mode=twoway,                                                validatesondataerrors=true,                                                notifyonvalidationerror=true}"> 

and in code behind change isdropdownopen property :

private void raddatetimepicker_selectionchanged(object sender, selectionchangedeventargs e) {     if (e.addeditems != null)     {         var datetimepicker = sender raddatetimepicker;         datetimepicker.isdropdownopen = false;     } } 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -