RadDateTimePicker properties

1 Answer 196 Views
DateTimePicker
Yogendra
Top achievements
Rank 1
Yogendra asked on 24 Feb 2022, 11:00 AM

Hi,

 

I want to know few of the properties which I was previously using in WPF Toolkit DateTimePicker and I am not able to find them in Telerik UI for WPF.

AllowSpin="False"
AllowTextInput="False"
Format="Custom"
AutoCloseCalendar="True"
FormatString="{Binding SiteShortDateTimeFormat, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay,                                         FallbackValue='MMM-dd-yyyy HH:mm'}"  IsEnabled="{Binding ExpirationEnabled}" Minimum="{Binding MinExpirationDate}" TimePickerVisibility="Collapsed"
Value="{Binding ExpirationDate, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" 

 

These all I want in telerik.

Please help me in this if possible.

 

Thanks,

Yogendra

1 Answer, 1 is accepted

Sort by
0
Dilyan Traykov
Telerik team
answered on 25 Feb 2022, 02:07 PM

Hi Yogendra,

Here is how you can achieve a similar setup with the RadDateTimePicker control:

AllowSpin - The spin feature is not available, so you can just ignore this value since it is set to False.
AllowTextInput - You can handle the PreviewTextInput event to disallow user input.
AutoCloseCalendar - You can handle the SelectionChanged event and set the IsDropDownOpen property to false.
Format & FormatString - You can define a custom format as explained in this article: Formatting.
IsEnabled - You can use the IsReadOnly property.
Minimum - This is equivalent to the SelectableDateStart property.
TimePickerVisibility - You can set the InputMode property to DatePicker.
Value - This is equivalent to the SelectedValue property.


For your convenience, I've prepared a small sample project to demonstrate how to handle the two events mentioned above.

Please have a look and let me know if you find the project and the provided information helpful.

Regards,
Dilyan Traykov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Yogendra
Top achievements
Rank 1
commented on 26 Feb 2022, 04:00 PM

Hi Dilyan,

Thanks for your quick response.
I am trying above, if any issue comes I will let you know.

 

Regards,

Yogendra

Dilyan Traykov
Telerik team
commented on 28 Feb 2022, 10:07 AM

Hi Yogendra,

Do let me know if something comes up.
Yogendra
Top achievements
Rank 1
commented on 28 Feb 2022, 10:13 AM | edited

Hi Dilyan,

For TimePickerVisibility previously we are using its values as Hidden, Collapsed, but as you said to use  You can set the InputMode property to DatePicker, so how to differentiate between Hidden and Collapsed.

 

and two more properties I was using

Text="{Binding FromDate,
                                       Mode=TwoWay,
                                       UpdateSourceTrigger=PropertyChanged,
                                       StringFormat=\{0:MMM-dd-yyyy \},
                                       TargetNullValue=''}"

 

ShowButtonSpinner="False"

So what will be its substitute in Telerik.

 

Regards,

Yogendra

Dilyan Traykov
Telerik team
commented on 01 Mar 2022, 01:15 PM

Hi Yogendra,

As there is no straightforward way to only hide the time picker part of the control via a property, you will need to edit the control template of the control to achieve this. I'm uncertain, however, if this would provide a suitable layout as it will result in an empty area in the control. With this said, if it is not an issue for you, I would suggest using the DatePicker InputMode which corresponds to the Collapsed value of the TimePickerVisibility property.

As for the other two properties:
Text - I believe you can use the DateTimeWatermarkContent property.
ShowButtonSpinner - Similarly to AllowSpin, as this functionality is not present in the RadDateTimePicker control, you can ignore this value.

I hope you find this information helpful.

Tags
DateTimePicker
Asked by
Yogendra
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
Share this question
or