Telerik RadDateTimePicker

3 Answers 110 Views
DateTimePicker
alex
Top achievements
Rank 2
Bronze
Iron
Iron
alex asked on 18 Nov 2022, 07:18 AM | edited on 23 Nov 2022, 06:33 AM

Hello,

I am insterested on change the RadDateTimePicker.

1. When set the control to change the minutes/seconds, the default control template shows all the possible options in buttons, a little bit annoying for the user.

The request: like Android, the user wants three numbers (hour, minute, seconds) that he can move up/down. Instead of scrolling we can use up/down arrows.

2. Add a button in the control to change 12/24 format and visibilty property for this button.

Questions:

1. Which approach do you suggest?

Override all the TimeControl template? or update tue default style ?

2. Which properties should I bind in case that I override the TimePicker to create a new template with three up down controls where each control will handle hours/minutes/seconds ?

3. Do you have any control that can set the number value with up down like Android (see attached picture)

4. For point 2, how can I add a control that will be set the date time format off the original RadTimePicker? 

I am not sure that creating a new custom control which contains the new control and telerik control will be the best approach. I want to add the control to the original one in the style.

5. Which property should be set to show 24 format. In the example you are showing a property that doesn't update the time correctly.

6. Do you have advanced examples with many styles and changes on Control Template ?

All the examples on the site are quiet simple, maybe did you get from users new examples.

 

Thanks,

This forum is so helpful.

 

3 Answers, 1 is accepted

Sort by
0
Accepted
alex
Top achievements
Rank 2
Bronze
Iron
Iron
answered on 23 Nov 2022, 06:10 PM
Nevermind, I collpased the clock part and added my new control to the RadDateTimePicker style directly.
0
Masha
Telerik team
answered on 18 Nov 2022, 11:50 AM

Hello Alex,

Unfortunately, the Telerik suit does not have such control. I suggest you use the RadTimeSpanPicker instead of the RadDateTime as it looks most appropriate for your goal. More about it you can be read in our online documentation. Inside the control template of RadTimeSpanPicker, you can add a custom button that will change the time format. You can check the configuration example of RadTimeSpan picker control in the Telerik WPF demo application.

I am attaching a demo project where the RadTimeSpan picker template is modified to have a similar design in its drop-down content. Please note that the project uses an implicit styles approach(NoXaml binaries and a Material theme).

I hope the above will be useful. Let me know if this suggestion works for you.


Masha
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.

alex
Top achievements
Rank 2
Bronze
Iron
Iron
commented on 23 Nov 2022, 06:41 AM

Thank you,

I created my own control. Then I override the PART_DropDownButton content.

I put the PART_Calendar and the PART_Clock. The calendar is TelerikRadCalendar and the clock is DateTimePickerClock (telerik) because it doesn't support other control.

Then I override the DateTimePickerClock template. In this ControlTemplate I put my clock. The time property is bound like this:

Time={Binding RelativeSource={RelativeSource TemplatedParent}, Path=SelectedTime, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}}"

 

Basically, my control Time property should be bound to the SelectedTime on the original DateTimePickerClock (which shows the time if I don't override the template).

 

I can't understand why the binding is null (even if I bind to a TextBlock to be sure that the problem is not on my new control).

Can you guide me with that?

0
Masha
Telerik team
answered on 24 Nov 2022, 07:03 AM

Hello Alex,

I am glad that you found a solution by yourself. 

If you have any questions regarding the control customization, let me know.

Regards,
Masha
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
DateTimePicker
Asked by
alex
Top achievements
Rank 2
Bronze
Iron
Iron
Answers by
alex
Top achievements
Rank 2
Bronze
Iron
Iron
Masha
Telerik team
Share this question
or