Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6549531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:06:15+00:00 2026-05-25T12:06:15+00:00

I am working on a WPF application that uses the Telerik RAD controls for

  • 0

I am working on a WPF application that uses the Telerik RAD controls for WPF. The application will be used on a PC with a touch screen, so I need to make things like pickers on the DateTimePicker control larger so they can be easily pressed by people with sausage fingers like my own.

I originally used Expression Blend to edit a copy of the control’s template. That created a ControlTemplate in the UserControl’s XAML file that I was designing. I have another UserControl I’m working on now that will also use the DateTimePicker, so I want to reuse the ControlTemplate.

What I did was I moved the modified template into a new named Style in the project’s (a WPF Control Library) Generic.XAML. Here’s a short snippet of the Generic.xaml:

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:CarSystem.CustomControls"
                    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" 
                    xmlns:Telerik_Windows_Controls_Chromes="clr-namespace:Telerik.Windows.Controls.Chromes;assembly=Telerik.Windows.Controls">

    <Style x:Key="RadDateTimePickerControlTemplate1" TargetType="{x:Type telerik:RadDateTimePicker}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type telerik:RadDateTimePicker}">
                                  . . .
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>

Here’s a snippet of the XAML where I reference the style:

<UserControl x:Class="CarSystem.CustomControls.ReportCriteria"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" 
             xmlns:cs="clr-namespace:CarSystem.CustomControls" 
             mc:Ignorable="d" 
             Height="648" 
             Width="1117">

    <Grid Background="{DynamicResource ContentBackground}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <GroupBox BorderBrush="Black" FontSize="20" FontWeight="Bold" Grid.Row="0" Header="Report Criteria: " Margin="5">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="320" />
                    <ColumnDefinition Width="200" />
                    <ColumnDefinition Width="450" />
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="110" />
                </Grid.ColumnDefinitions>

                <GroupBox BorderBrush="Black" FontSize="20" FontWeight="Bold" Grid.Column="0" Header="Date Range:" Margin="5">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="1*" />
                            <ColumnDefinition Width="2*" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <TextBlock FontSize="18" 
                                   FontWeight="Bold" 
                                   Grid.Column="0" 
                                   Grid.Row="0" 
                                   HorizontalAlignment="Right" 
                                   Text="Start Date:  " />
                        <telerik:RadDateTimePicker FontSize="18" 
                                                   FontWeight="Bold" 
                                                   Grid.Column="1" 
                                                   Grid.Row="0" 
                                                   Name="StartDatePicker" 
                                                   Style="{DynamicResource RadDateTimePickerControlTemplate1}" />
                        <TextBlock FontSize="18" 
                                   FontWeight="Bold" 
                                   Grid.Column="0" 
                                   Grid.Row="1" 
                                   HorizontalAlignment="Right" 
                                   Text="End Date:  " />
                        <telerik:RadDateTimePicker FontSize="18" 
                                                   FontWeight="Bold" 
                                                   Grid.Column="1" 
                                                   Grid.Row="1" 
                                                   Name="EndDatePicker" 
                                                   Style="{DynamicResource RadDateTimePickerControlTemplate1}" />
                    </Grid>
                </GroupBox>
                        . . .

        </GroupBox>
    </Grid>
</UserControl>

When I work in Expression Blend, everything looks fine. I see the change in the width of the drop down button for the control. Back in Visual Studio, everything compiles fine, but the change does not show up — I see the default style for the control only, and the references to the style have a blue squiggly line under them. When you hover the mouse over the squiggly line, the following message is displayed:

     The resource "RadDateTimePickerControlTemplate1" cannot be resolved.

The same thing happens if I change “DynamicResource” to “StaticResource” in the XAML. Also, I have made no changes to the Assembly.Info file for the project.

How do I fix this?

Thanks

Tony

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T12:06:15+00:00Added an answer on May 25, 2026 at 12:06 pm

    As far as I remember you can’t have named resources you want to reference in generic.xaml – that you have to put in app.xaml

    You have to give the type in key for styles or ComponentResourceKey in key for controltemplates
    and in the class static constructor override metadata like:

      public class FlatStylebutton : Button
      {
        static FlatStylebutton()
        {
          DefaultStyleKeyProperty.OverrideMetadata(typeof(FlatStylebutton), new FrameworkPropertyMetadata(typeof(FlatStylebutton)));
        }
      }
    

    So a solution to your problem could be moving the style to app.xaml

    Alternatively you can put it in a separate ResourceDictionary xaml file and import it in ResourceDictionary.MergedDictionaries

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on an WPF application that uses a BusinessLogic layer (currently a
I was working with a WPF application and I decided that the controls and
I'm working on an application that uses WPF and WCF. As it stands now,
I've been working on a WPF application that uses WCF to access the server
I'm working on a WPF application that sometimes exhibits odd problems and appears to
I am working on a WPF application which has a treeview that represents an
I have a project I'm working on that requires our WPF application read SMS
I'm working on a mobile application (C#/WPF on a tablet PC) that prints to
I am working on a wpf application. Here I need to use System.Windows.Forms.FolderBrowserDialog in
I have built a WP7.1 application that uses a local database. I used sqlmetal

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.