Seconds choice over 1 day

2 posts, 0 answers
  1. Karl
    Karl avatar
    4 posts
    Member since:
    Oct 2014

    Posted 22 Oct 2018 Link to this post

    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.

  2. Vladimir Stoyanov
    Admin
    Vladimir Stoyanov avatar
    405 posts

    Posted 25 Oct 2018 Link to this post

    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.
Back to Top