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

PreserveSpaceForCollapsedChildren

1 Answer 46 Views
DatePicker
This is a migrated thread and some comments may be shown as answers.
Joel
Top achievements
Rank 2
Iron
Iron
Iron
Joel asked on 18 Sep 2018, 05:56 PM

I have a touch based application that uses a large font (Segoe UI 28) .  I need to force the Year/Decade Panels to display correctly.  How do I prevent the host panel from collapsing when I pick a year (it goes from wide accommodating the entire calendar down to listing only the Years) and I need to guarantee it doesn't crowd the years into a very small place?

 

1 Answer, 1 is accepted

Sort by
0
Dilyan Traykov
Telerik team
answered on 21 Sep 2018, 10:08 AM
Hello Joel,

I have two suggestions on how to achieve the desired result:

1) You can set a MinWidth for the RadCalendar displayed by the RadDateTimePicker via its CalendarStyle property:

<Style TargetType="telerik:RadCalendar" x:Key="CalendarStyle">
    <Setter Property="MinWidth" Value="350" />
</Style>

2) You can also specify some padding for the calendar's buttons in the respective views, like this:

<Style TargetType="telerik:RadCalendar" x:Key="CalendarStyle">
    <Setter Property="MonthButtonStyle">
        <Setter.Value>
            <Style TargetType="calendar:CalendarButton" >
                <Setter Property="Padding" Value="10" />
            </Style>
        </Setter.Value>
    </Setter>
    <Setter Property="YearButtonStyle">
        <Setter.Value>
            <Style TargetType="calendar:CalendarButton" >
                <Setter Property="Padding" Value="10" />
            </Style>
        </Setter.Value>
    </Setter>
</Style>

Please note that the calendar namespace in the above snippet is defined as follows:

xmlns:calendar="clr-namespace:Telerik.Windows.Controls.Calendar;assembly=Telerik.Windows.Controls.Input"

Both styles can then be applied like this:

<telerik:RadDateTimePicker CalendarStyle="{StaticResource CalendarStyle}" />

Please let me know if any of these approaches work for you.

Regards,
Dilyan Traykov
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
DatePicker
Asked by
Joel
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Dilyan Traykov
Telerik team
Share this question
or