This is a migrated thread and some comments may be shown as answers.

Seconds choice over 1 day

1 Answer 111 Views
DateTimePicker
This is a migrated thread and some comments may be shown as answers.
Karl
Top achievements
Rank 1
Karl asked on 22 Oct 2018, 12:46 PM

I'm needing the datetimepicker to allow the user to select an option for each second over the day, but when i'm down to just 15 minutes the boxes get too small for being able to see the text. 

I've scrolled view documentation and the forum and can't find any solution.

1 Answer, 1 is accepted

Sort by
0
Vladimir Stoyanov
Telerik team
answered on 25 Oct 2018, 12:30 PM
Hello Karl,

By default, the part of the RadDateTimePicker's dropdown, which hosts the date items, is a RadClock. It hosts all of the items inside a RadUniformGrid and by default it has its Columns property set to four(this poses a restriction on the number of date items that can be displayed). You can set the ClockStyle property of the RadDateTimePicker, where you can change the Columns property of the uniform grid. Here is what I have in mind:

<Style x:Key="CustomClockStyle" TargetType="telerik:RadClock" BasedOn="{StaticResource RadClockStyle}">
            <Setter Property="ItemsPanel">
                <Setter.Value>
                    <ItemsPanelTemplate>
                        <primitives:RadUniformGrid x:Name="uniformGrid" Columns="10"/>
                    </ItemsPanelTemplate>
                </Setter.Value>
            </Setter>
</Style>

Where "primitives" points to: "xmlns:primitives="clr-namespace:Telerik.Windows.Controls.Primitives;assembly=Telerik.Windows.Controls"". 

<telerik:RadDateTimePicker ClockStyle="{StaticResource CustomClockStyle}" />

This way you will be able to display more date items, however depending on the number of date items that you want to show, you can also consider swapping the RadUniformGrid for a different panel.

Hope this helps. Let me know if I can be of any further assistance.

Regards,
Vladimir Stoyanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
DateTimePicker
Asked by
Karl
Top achievements
Rank 1
Answers by
Vladimir Stoyanov
Telerik team
Share this question
or