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

Style interferes with drop down event

2 Answers 53 Views
DatePicker
This is a migrated thread and some comments may be shown as answers.
Kathy
Top achievements
Rank 1
Veteran
Kathy asked on 23 Apr 2020, 02:08 PM

I am doing something very simple. I am trying to apply a simple style to a DateTimePicker.  Basically, if I use the line 

CalendarStyle="{StaticResource calendarStyle}", the drop down calendar doesn't show up. If I remove the line, the calendar works as expected. I'm using runtime version v4.0.30319, description is ProgressĀ® TelerikĀ® UI for WPF. Here is the xaml:

<Window x:Class="RadDatePicker.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
  xmlns:local="clr-namespace:RadDatePicker"
        Title="MainWindow" Height="350" Width="935">
    <Window.Resources>
        <Style x:Key="calendarStyle" TargetType="telerik:RadCalendar">
            <Setter Property="AreWeekNumbersVisible" Value="True" />
        </Style>
    </Window.Resources>
    <Grid Height="207">
        <Border CornerRadius="6" >
            <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
                <telerik:RadDatePicker x:Name="datePicker"
                   InputMode="DatePicker"
                   DisplayFormat="Short"
                   DateTimeWatermarkContent="Enter date"
                   DateSelectionMode="Day"
                   CalendarStyle="{StaticResource calendarStyle}" />
            </StackPanel>
        </Border>
    </Grid>
</Window>

 

2 Answers, 1 is accepted

Sort by
0
Vladimir Stoyanov
Telerik team
answered on 27 Apr 2020, 12:22 PM

Hello Kathy,

Thank you for the shared code snippet. 

Based on the shared information, I am assuming that you are using the NoXaml dlls. If that is indeed the case, you have to base any custom styles on a theme's default style. Here is how that would look like for the CalendarStyle:

  <Style x:Key="calendarStyle" TargetType="telerik:RadCalendar" BasedOn="{StaticResource RadCalendarStyle}">
            <Setter Property="AreWeekNumbersVisible" Value="True" />
        </Style>

I hope you find this helpful.

Regards,
Vladimir Stoyanov
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Kathy
Top achievements
Rank 1
Veteran
answered on 27 Apr 2020, 01:08 PM
Thank you. That did the trick.
Tags
DatePicker
Asked by
Kathy
Top achievements
Rank 1
Veteran
Answers by
Vladimir Stoyanov
Telerik team
Kathy
Top achievements
Rank 1
Veteran
Share this question
or