DateTimePicker textbox style

3 posts, 0 answers
  1. Tigran
    Tigran avatar
    16 posts
    Member since:
    Jul 2014

    Posted 18 Sep 2014 Link to this post

    Hello,

    I'm using RadDateTimePicker in my project and I want to customize textbox( for example change background). I found this code and decided to make changes on it to change background, but it gave a lot of build errors.

    <Window
             
        xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
        xmlns:telerikInput="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input"
        xmlns:System="clr-namespace:System;assembly=mscorlib" xmlns:Telerik_Windows_Controls_Calendar="clr-namespace:Telerik.Windows.Controls.Calendar;assembly=Telerik.Windows.Controls.Input" xmlns:Telerik_Windows_Controls_Primitives="clr-namespace:Telerik.Windows.Controls.Primitives;assembly=Telerik.Windows.Controls"
        x:Class="TelerikGridView.Window1"
        Title="Window1" Height="300" Width="300">
     
        <Window.Resources>
            <Style x:Key="RadDatePickerStyle" TargetType="{x:Type telerikInput:RadDatePicker}">
                <Setter Property="IsEnabled" Value="True"/>
                <Setter Property="IsTabStop" Value="False"/>
                <Setter Property="Background" Value="Red"/>
                <Setter Property="MinHeight" Value="22"/>
                <Setter Property="Padding" Value="4,0"/>
                <Setter Property="BorderBrush" Value="#FF888688"/>
                <Setter Property="BorderThickness" Value="1"/>
                <Setter Property="VerticalContentAlignment" Value="Center"/>
                <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type telerikInput:RadDatePicker}">
                            <Grid>
                                <Border x:Name="InnerBorder" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                                    <Grid x:Name="Placement">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="*"/>
                                            <ColumnDefinition Width="Auto"/>
                                        </Grid.ColumnDefinitions>
                                        <telerik:PickerTextBox  x:Name="InputBox" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" IsTabStop="True" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" IsEnabled="{TemplateBinding IsEnabled}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Grid.Column="0" AcceptsReturn="False" IsReadOnly="{TemplateBinding IsReadOnly}">
                                            <!--<telerik:StyleManager.Theme>
                                                <telerik:Office_BlackTheme/>
                                            </telerik:StyleManager.Theme>-->
                                        </telerik:PickerTextBox>
                                        <ToggleButton x:Name="ToggleButtonElement" MinWidth="20" IsTabStop="False" IsEnabled="{TemplateBinding IsEnabled}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Grid.Column="1" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}">
                                            <ToggleButton.Style>
                                                <Style TargetType="{x:Type ToggleButton}">
                                                    <Setter Property="IsEnabled" Value="True"/>
                                                    <Setter Property="IsTabStop" Value="False"/>
                                                    <Setter Property="Background" Value="#FF003255"/>
                                                    <Setter Property="Foreground" Value="#FF313131"/>
                                                    <Setter Property="HorizontalContentAlignment" Value="Center"/>
                                                    <Setter Property="VerticalContentAlignment" Value="Center"/>
                                                    <Setter Property="Cursor" Value="Arrow"/>
                                                    <Setter Property="FontSize" Value="11"/>
                                                    <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
                                                    <Setter Property="IsTabStop" Value="False"/>
                                                    <Setter Property="Template">
                                                        <Setter.Value>
                                                            <ControlTemplate TargetType="{x:Type ToggleButton}">
                                                                <Grid x:Name="Root">
                                                                    <Border x:Name="Border">
                                                                        <Border.Background>
                                                                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                                                <GradientStop Color="#FFF2F2F2" Offset="0"/>
                                                                                <GradientStop Color="#FFD6D6D6" Offset="1"/>
                                                                                <GradientStop Color="#FFD8D8D8" Offset="0.5"/>
                                                                                <GradientStop Color="#FFC2C2C2" Offset="0.51"/>
                                                                            </LinearGradientBrush>
                                                                        </Border.Background>
                                                                    </Border>
                                                                    <Border x:Name="BorderChecked" Visibility="Collapsed">
                                                                        <Border.Background>
                                                                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                                                <GradientStop Color="#FFEDE1BB" Offset="0"/>
                                                                                <GradientStop Color="#FFFDE15F" Offset="1"/>
                                                                                <GradientStop Color="#FFFBC277" Offset="0.5"/>
                                                                                <GradientStop Color="#FFFDAB38" Offset="0.51"/>
                                                                            </LinearGradientBrush>
                                                                        </Border.Background>
                                                                    </Border>
                                                                    <Image Height="15">
                                                                        <Image.Source>
                                                                            <BitmapImage UriSource="pack://application:,,,/Telerik.Windows.Controls.Input;component/RadDatepicker.png"/>
                                                                        </Image.Source>
                                                                    </Image>
                                                                    <Grid x:Name="FocusVisual" Opacity="0" Visibility="Collapsed"/>
                                                                    <Rectangle x:Name="DisabledVisual" Fill="#99FFFFFF" Opacity="0"/>
                                                                    <ContentPresenter Margin="{TemplateBinding Padding}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                                                                </Grid>
                                                                <ControlTemplate.Triggers>
                                                                    <Trigger Property="IsMouseOver" Value="True">
                                                                        <Setter Property="Background" TargetName="Border">
                                                                            <Setter.Value>
                                                                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                                                    <GradientStop Color="#FFFEFDF1" Offset="0"/>
                                                                                    <GradientStop Color="#FFFEE699" Offset="1"/>
                                                                                    <GradientStop Color="#FFFEEBAA" Offset="0.5"/>
                                                                                    <GradientStop Color="#FFFED560" Offset="0.51"/>
                                                                                </LinearGradientBrush>
                                                                            </Setter.Value>
                                                                        </Setter>
                                                                    </Trigger>
                                                                    <Trigger Property="IsFocused" Value="True"/>
                                                                    <Trigger Property="IsPressed" Value="True">
                                                                        <Setter Property="Background" TargetName="Border">
                                                                            <Setter.Value>
                                                                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                                                    <GradientStop Color="#FFEDE1BB" Offset="0"/>
                                                                                    <GradientStop Color="#FFFDE15F" Offset="1"/>
                                                                                    <GradientStop Color="#FFFBC277" Offset="0.5"/>
                                                                                    <GradientStop Color="#FFFDAB38" Offset="0.51"/>
                                                                                </LinearGradientBrush>
                                                                            </Setter.Value>
                                                                        </Setter>
                                                                    </Trigger>
                                                                    <Trigger Property="IsChecked" Value="True">
                                                                        <Setter Property="Visibility" TargetName="BorderChecked" Value="Visible"/>
                                                                    </Trigger>
                                                                </ControlTemplate.Triggers>
                                                            </ControlTemplate>
                                                        </Setter.Value>
                                                    </Setter>
                                                </Style>
                                            </ToggleButton.Style>
                                        </ToggleButton>
                                        <Border x:Name="RightBorder" Grid.Column="0" BorderBrush="#FF888688" BorderThickness="0,0,1,0"/>
                                        <Border x:Name="ValidationErrorElement" Visibility="Collapsed" BorderBrush="#FFDB000C" BorderThickness="1" CornerRadius="1">
                                            <Border.ToolTip>
                                                <ToolTip x:Name="validationTooltip" Placement="Right">
                                                    <ToolTip.Template>
                                                        <ControlTemplate TargetType="{x:Type ToolTip}">
                                                            <Grid x:Name="Root" Margin="5,0" Opacity="0" RenderTransformOrigin="0,0">
                                                                <Grid.RenderTransform>
                                                                    <TranslateTransform X="-25"/>
                                                                </Grid.RenderTransform>
                                                                <Border Background="#FFDC000C" CornerRadius="2"/>
                                                                <Border CornerRadius="2">
                                                                    <TextBlock Margin="8,3" MaxWidth="250" Foreground="White" Text="{Binding (Validation.Errors)[0].ErrorContent}" TextWrapping="Wrap"/>
                                                                </Border>
                                                            </Grid>
                                                            <ControlTemplate.Triggers>
                                                                <Trigger Property="IsOpen" Value="True">
                                                                    <Trigger.EnterActions>
                                                                        <BeginStoryboard>
                                                                            <Storyboard x:Name="OpenAnimation">
                                                                                <DoubleAnimation Duration="00:00:00.2000000" Storyboard.TargetName="xform" Storyboard.TargetProperty="X" To="0"/>
                                                                                <DoubleAnimation Duration="00:00:00.2000000" Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity" To="1"/>
                                                                            </Storyboard>
                                                                        </BeginStoryboard>
                                                                    </Trigger.EnterActions>
                                                                    <Trigger.ExitActions>
                                                                        <StopStoryboard BeginStoryboardName="OpenAnimation"/>
                                                                    </Trigger.ExitActions>
                                                                </Trigger>
                                                                <Trigger Property="IsOpen" Value="True">
                                                                    <Setter Property="RenderTransform" TargetName="Root">
                                                                        <Setter.Value>
                                                                            <TranslateTransform X="0"/>
                                                                        </Setter.Value>
                                                                    </Setter>
                                                                    <Setter Property="Opacity" TargetName="Root" Value="1"/>
                                                                </Trigger>
                                                                <Trigger Property="IsOpen" Value="False">
                                                                    <Setter Property="Opacity" TargetName="Root" Value="0"/>
                                                                </Trigger>
                                                            </ControlTemplate.Triggers>
                                                        </ControlTemplate>
                                                    </ToolTip.Template>
                                                    <ToolTip.Triggers>
                                                        <EventTrigger RoutedEvent="FrameworkElement.Loaded">
                                                            <BeginStoryboard>
                                                                <Storyboard>
                                                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="validationTooltip" Storyboard.TargetProperty="IsHitTestVisible">
                                                                        <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                                            <DiscreteObjectKeyFrame.Value>
                                                                                <System:Boolean>True</System:Boolean>
                                                                            </DiscreteObjectKeyFrame.Value>
                                                                        </DiscreteObjectKeyFrame>
                                                                    </ObjectAnimationUsingKeyFrames>
                                                                </Storyboard>
                                                            </BeginStoryboard>
                                                        </EventTrigger>
                                                    </ToolTip.Triggers>
                                                </ToolTip>
                                            </Border.ToolTip>
                                            <Grid HorizontalAlignment="Right" Margin="1,-4,-4,0" VerticalAlignment="Top" Width="12" Height="12" Background="Transparent">
                                                <Path Fill="#FFDC000C" Margin="1,3,0,0" Data="M1,0L6,0A2,2,90,0,1,8,2L8,7z"/>
                                                <Path Fill="White" Margin="1,3,0,0" Data="M0,0L2,0 8,6 8,8"/>
                                            </Grid>
                                        </Border>
                                    </Grid>
                                </Border>
                                <Popup x:Name="PART_Popup" AllowsTransparency="True" IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Bottom" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" StaysOpen="False">
                                    <Grid x:Name="DropDownRoot">
                                        <telerikInput:RadCalendar x:Name="CalendarElement" Style="{DynamicResource RadCalendarStyle}" Background="#FFF0F1F2" IsEnabled="{TemplateBinding IsEnabled}" AreWeekNamesVisible="{TemplateBinding AreWeekNamesVisible}" AreWeekNumbersVisible="{TemplateBinding AreWeekNumbersVisible}" CalendarWeekRule="{TemplateBinding CalendarWeekRule}" CenturyViewHeaderFormat="{TemplateBinding CenturyViewHeaderFormat}" CenturyViewPanel="{TemplateBinding CenturyViewPanel}" CenturyViewStyle="{TemplateBinding CenturyViewStyle}" Columns="{TemplateBinding Columns}" Culture="{TemplateBinding Culture}" DayButtonStyle="{TemplateBinding DayButtonStyle}" DayButtonStyleSelector="{TemplateBinding DayButtonStyleSelector}" DayTemplate="{TemplateBinding DayTemplate}" DayTemplateSelector="{TemplateBinding DayTemplateSelector}" DecadeButtonStyle="{TemplateBinding DecadeButtonStyle}" DecadeButtonStyleSelector="{TemplateBinding DecadeButtonStyleSelector}" DecadeTemplate="{TemplateBinding DecadeTemplate}" DecadeTemplateSelector="{TemplateBinding DecadeTemplateSelector}" DecadeViewHeaderFormat="{TemplateBinding DecadeViewHeaderFormat}" DecadeViewPanel="{TemplateBinding DecadeViewPanel}" DecadeViewStyle="{TemplateBinding DecadeViewStyle}" DisplayDate="{TemplateBinding DisplayDate}" DisplayDateEnd="{TemplateBinding DisplayDateEnd}" DisplayDateStart="{TemplateBinding DisplayDateStart}" DisplayMode="{TemplateBinding DisplayMode}" FirstDayOfWeek="{TemplateBinding FirstDayOfWeek}" HeaderVisibility="{TemplateBinding HeaderVisibility}" IsTodayHighlighted="{TemplateBinding IsTodayHighlighted}" MonthButtonStyle="{TemplateBinding MonthButtonStyle}" MonthButtonStyleSelector="{TemplateBinding MonthButtonStyleSelector}" MonthTemplate="{TemplateBinding MonthTemplate}" MonthTemplateSelector="{TemplateBinding MonthTemplateSelector}" MonthViewHeaderFormat="{TemplateBinding MonthViewHeaderFormat}" MonthViewPanel="{TemplateBinding MonthViewPanel}" MonthViewStyle="{TemplateBinding MonthViewStyle}" Orientation="{TemplateBinding Orientation}" Rows="{TemplateBinding Rows}" SelectableDateEnd="{TemplateBinding SelectableDateEnd}" SelectableDateStart="{TemplateBinding SelectableDateStart}" SelectedDate="{TemplateBinding SelectedDate}" SelectionMode="Single" ViewsHeaderVisibility="{TemplateBinding ViewsHeaderVisibility}" YearButtonStyle="{TemplateBinding YearButtonStyle}" YearButtonStyleSelector="{TemplateBinding YearButtonStyleSelector}" YearTemplate="{TemplateBinding YearTemplate}" YearTemplateSelector="{TemplateBinding YearTemplateSelector}" YearViewHeaderFormat="{TemplateBinding YearViewHeaderFormat}" YearViewPanel="{TemplateBinding YearViewPanel}" YearViewStyle="{TemplateBinding YearViewStyle}">
                                            <telerik:StyleManager.Theme>
                                                <telerik:Office_BlackTheme/>
                                            </telerik:StyleManager.Theme>
                                        </telerikInput:RadCalendar>
                                    </Grid>
                                </Popup>
                                <Rectangle x:Name="DisabledVisual" Fill="#99FFFFFF" Visibility="Collapsed"/>
                            </Grid>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsMouseOver" Value="True">
                                    <Setter Property="BorderBrush" TargetName="InnerBorder" Value="#FFFFBD69"/>
                                    <Setter Property="BorderBrush" TargetName="RightBorder" Value="#FFFFBD69"/>
                                </Trigger>
                                <Trigger Property="IsEnabled" Value="False">
                                    <Setter Property="Visibility" TargetName="DisabledVisual" Value="Visible"/>
                                </Trigger>
                                <Trigger Property="IsKeyboardFocusWithin" Value="True">
                                    <Setter Property="BorderBrush" TargetName="InnerBorder" Value="#FFFFBD69"/>
                                    <Setter Property="BorderBrush" TargetName="RightBorder" Value="#FFFFBD69"/>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="Columns" Value="1"/>
                <Setter Property="Rows" Value="1"/>
                <Setter Property="MonthViewPanel">
                    <Setter.Value>
                        <ItemsPanelTemplate>
                            <Telerik_Windows_Controls_Calendar:CalendarPanel IsItemsHost="True" ChildrenFlow="Horizontal" Columns="8" FirstColumn="1" PreserveSpaceForCollapsedChildren="True" Rows="7"/>
                        </ItemsPanelTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="YearViewPanel">
                    <Setter.Value>
                        <ItemsPanelTemplate>
                            <Telerik_Windows_Controls_Calendar:CalendarPanel VerticalAlignment="Stretch" IsItemsHost="True" Columns="4" PreserveSpaceForCollapsedChildren="True" Rows="3"/>
                        </ItemsPanelTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="DecadeViewPanel">
                    <Setter.Value>
                        <ItemsPanelTemplate>
                            <Telerik_Windows_Controls_Calendar:CalendarPanel VerticalAlignment="Stretch" IsItemsHost="True" Columns="4" PreserveSpaceForCollapsedChildren="True" Rows="3"/>
                        </ItemsPanelTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="CenturyViewPanel">
                    <Setter.Value>
                        <ItemsPanelTemplate>
                            <Telerik_Windows_Controls_Calendar:CalendarPanel VerticalAlignment="Stretch" IsItemsHost="True" Columns="4" PreserveSpaceForCollapsedChildren="True" Rows="3"/>
                        </ItemsPanelTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="MonthViewStyle">
                    <Setter.Value>
                        <Style TargetType="{x:Type Telerik_Windows_Controls_Calendar:CalendarView}">
                            <Setter Property="Template">
                                <Setter.Value>
                                    <ControlTemplate TargetType="{x:Type Telerik_Windows_Controls_Calendar:CalendarView}">
                                        <Grid>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="*"/>
                                            </Grid.RowDefinitions>
                                            <Border Visibility="{TemplateBinding HeaderVisibility}" Background="Transparent" BorderBrush="Transparent" BorderThickness="0,0,0,1"/>
                                            <ContentControl HorizontalAlignment="Center" Margin="0,2" Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}" Foreground="Black" Visibility="{TemplateBinding HeaderVisibility}"/>
                                            <Grid Grid.Row="1">
                                                <Grid.RowDefinitions>
                                                    <RowDefinition Height="*"/>
                                                    <RowDefinition Height="*"/>
                                                    <RowDefinition Height="*"/>
                                                    <RowDefinition Height="*"/>
                                                    <RowDefinition Height="*"/>
                                                    <RowDefinition Height="*"/>
                                                    <RowDefinition Height="*"/>
                                                </Grid.RowDefinitions>
                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition Width="*"/>
                                                    <ColumnDefinition Width="7*"/>
                                                </Grid.ColumnDefinitions>
                                                <Border Grid.RowSpan="7" Background="#FFD2D4DA">
                                                    <Border.Visibility>
                                                        <Binding Path="HideColumn" Mode="TwoWay" RelativeSource="{RelativeSource TemplatedParent}">
                                                            <Binding.Converter>
                                                                <telerik:InvertedBooleanToVisibilityConverter/>
                                                            </Binding.Converter>
                                                        </Binding>
                                                    </Border.Visibility>
                                                </Border>
                                                <Border Grid.ColumnSpan="2" Background="#FFD2D4DA" BorderBrush="#FF9199A4" BorderThickness="0,0,0,1">
                                                    <Border.Visibility>
                                                        <Binding Path="HideRow" Mode="TwoWay" RelativeSource="{RelativeSource TemplatedParent}">
                                                            <Binding.Converter>
                                                                <telerik:InvertedBooleanToVisibilityConverter/>
                                                            </Binding.Converter>
                                                        </Binding>
                                                    </Border.Visibility>
                                                </Border>
                                            </Grid>
                                            <ItemsPresenter Grid.Row="1"/>
                                        </Grid>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Margin" Value="0"/>
                            <Setter Property="MinHeight" Value="150"/>
                            <Setter Property="MinWidth" Value="240"/>
                        </Style>
                    </Setter.Value>
                </Setter>
                <Setter Property="DayTemplate">
                    <Setter.Value>
                        <DataTemplate>
                            <TextBlock Text="{Binding Text}"/>
                        </DataTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="MonthTemplate">
                    <Setter.Value>
                        <DataTemplate>
                            <TextBlock Text="{Binding Text}"/>
                        </DataTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="DecadeTemplate">
                    <Setter.Value>
                        <DataTemplate>
                            <TextBlock Text="{Binding Text}"/>
                        </DataTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="YearTemplate">
                    <Setter.Value>
                        <DataTemplate>
                            <TextBlock Text="{Binding Text}"/>
                        </DataTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="ViewsHeaderVisibility" Value="Collapsed"/>
            </Style>
            <Style x:Key="RadCalendarStyle" TargetType="{x:Type telerikInput:RadCalendar}">
                <Setter Property="Columns" Value="1"/>
                <Setter Property="Rows" Value="1"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type telerikInput:RadCalendar}">
                            <Grid>
                                <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                                    <Grid>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="*"/>
                                        </Grid.RowDefinitions>
                                        <Border Grid.RowSpan="2" Background="{TemplateBinding Background}"/>
                                        <Border BorderThickness="0,0,0,1">
                                            <Border.BorderBrush>
                                                <LinearGradientBrush EndPoint="0.714,1.292" StartPoint="0.318,0.068">
                                                    <GradientStop Color="#FFDBDCDE" Offset="0.39079609253679837"/>
                                                    <GradientStop Color="#FFC6C7C8" Offset="1"/>
                                                </LinearGradientBrush>
                                            </Border.BorderBrush>
                                            <Border.Background>
                                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                    <GradientStop Color="#FFF8F8F9" Offset="0"/>
                                                    <GradientStop Color="#FFDBDEE1" Offset="1"/>
                                                    <GradientStop Color="#FFDFE2E5" Offset="0.4"/>
                                                    <GradientStop Color="#FFC7CBD1" Offset="0.4"/>
                                                </LinearGradientBrush>
                                            </Border.Background>
                                        </Border>
                                        <Grid x:Name="header" Visibility="{TemplateBinding HeaderVisibility}">
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="*"/>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="*"/>
                                            </Grid.ColumnDefinitions>
                                            <RepeatButton x:Name="MoveLeft" Height="29">
                                                <RepeatButton.Style>
                                                    <Style TargetType="{x:Type RepeatButton}">
                                                        <Setter Property="Template">
                                                            <Setter.Value>
                                                                <ControlTemplate TargetType="{x:Type RepeatButton}">
                                                                    <Grid Background="Transparent">
                                                                        <Grid Margin="14,5,0,4">
                                                                            <Rectangle Fill="Transparent"/>
                                                                            <Path x:Name="ArrowPath" Fill="#FF9199A4" Stretch="Fill" Cursor="Hand" HorizontalAlignment="Left" VerticalAlignment="Center" Width="5" Height="9" Data="F1M-2.54313E-06,-12L1.33333,-12 1.33333,-10.6667 2.66667,-10.6667 2.66667,-9.3334 4,-9.3334 4,-8.00001 5.33333,-8.00001 5.33333,-6.66667 6.66667,-6.66667 6.66667,-5.33334 5.33333,-5.33334 5.33333,-4.00001 4,-4.00001 4,-2.66673 2.66667,-2.66673 2.66667,-1.33341 1.33333,-1.33341 1.33333,0 -2.54313E-06,0 -2.54313E-06,-12z">
                                                                                <Path.RenderTransform>
                                                                                    <TransformGroup>
                                                                                        <ScaleTransform ScaleX="1" ScaleY="1"/>
                                                                                        <SkewTransform AngleX="0" AngleY="0"/>
                                                                                        <RotateTransform Angle="-180"/>
                                                                                        <TranslateTransform X="0" Y="8"/>
                                                                                    </TransformGroup>
                                                                                </Path.RenderTransform>
                                                                            </Path>
                                                                        </Grid>
                                                                    </Grid>
                                                                    <ControlTemplate.Triggers>
                                                                        <Trigger Property="IsPressed" Value="True">
                                                                            <Setter Property="Fill" TargetName="ArrowPath" Value="#FF9199A4"/>
                                                                        </Trigger>
                                                                        <Trigger Property="IsMouseOver" Value="True">
                                                                            <Setter Property="Fill" TargetName="ArrowPath" Value="#FF9199A4"/>
                                                                        </Trigger>
                                                                        <Trigger Property="IsEnabled" Value="False">
                                                                            <Setter Property="Fill" TargetName="ArrowPath" Value="#599199A4"/>
                                                                        </Trigger>
                                                                    </ControlTemplate.Triggers>
                                                                </ControlTemplate>
                                                            </Setter.Value>
                                                        </Setter>
                                                    </Style>
                                                </RepeatButton.Style>
                                            </RepeatButton>
                                            <Button x:Name="Header" Padding="10,0" Grid.Column="1">
                                                <Button.Style>
                                                    <Style TargetType="{x:Type Button}">
                                                        <Setter Property="Template">
                                                            <Setter.Value>
                                                                <ControlTemplate TargetType="{x:Type Button}">
                                                                    <Grid x:Name="RootElement" Margin="0" Background="Transparent">
                                                                        <Rectangle Fill="Transparent"/>
                                                                        <!-- NOTE: -->
                                                                        <TextBlock x:Name="buttonContent" Text="{TemplateBinding Content}" Foreground="Red" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center" />
                                                                        <!-- <ContentControl x:Name="buttonContent" Foreground="Red" HorizontalAlignment="Center" Margin="{TemplateBinding Padding}" VerticalAlignment="Center" TextElement.Foreground="#FF9199A4" RenderTransformOrigin="0.5,0.5" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" ContentTemplate="{TemplateBinding ContentTemplate}"/> -->
                                                                    </Grid>
                                                                    <!--
                                                                    <ControlTemplate.Triggers>
                                                                        <Trigger Property="IsMouseOver" Value="True">
                                                                            <Setter Property="TextElement.Foreground" TargetName="buttonContent" Value="#FF9199A4"/>
                                                                        </Trigger>
                                                                        <Trigger Property="IsPressed" Value="True">
                                                                            <Setter Property="TextElement.Foreground" TargetName="buttonContent" Value="#FF9199A4"/>
                                                                        </Trigger>
                                                                        <Trigger Property="IsEnabled" Value="False">
                                                                            <Setter Property="TextElement.Foreground" TargetName="buttonContent" Value="#599199A4"/>
                                                                        </Trigger>
                                                                    </ControlTemplate.Triggers>
                                                                    -->
                                                                </ControlTemplate>
                                                            </Setter.Value>
                                                        </Setter>
                                                        <Setter Property="Foreground" Value="Black"/>
                                                        <Setter Property="Cursor" Value="Hand"/>
                                                    </Style>
                                                </Button.Style>
                                            </Button>
                                            <RepeatButton x:Name="MoveRight" Height="29" Grid.Column="2">
                                                <RepeatButton.Style>
                                                    <Style TargetType="{x:Type RepeatButton}">
                                                        <Setter Property="Template">
                                                            <Setter.Value>
                                                                <ControlTemplate TargetType="{x:Type RepeatButton}">
                                                                    <Grid Background="Transparent">
                                                                        <Grid Margin="0,5,15,4">
                                                                            <Rectangle Fill="Transparent"/>
                                                                            <Path x:Name="ArrowPath" Fill="#FF9199A4" Stretch="Fill" Cursor="Hand" HorizontalAlignment="Right" VerticalAlignment="Center" Width="5" Height="9" Data="F1M-2.54313E-06,-12L1.33333,-12 1.33333,-10.6667 2.66667,-10.6667 2.66667,-9.3334 4,-9.3334 4,-8.00001 5.33333,-8.00001 5.33333,-6.66667 6.66667,-6.66667 6.66667,-5.33334 5.33333,-5.33334 5.33333,-4.00001 4,-4.00001 4,-2.66673 2.66667,-2.66673 2.66667,-1.33341 1.33333,-1.33341 1.33333,0 -2.54313E-06,0 -2.54313E-06,-12z"/>
                                                                        </Grid>
                                                                    </Grid>
                                                                    <ControlTemplate.Triggers>
                                                                        <Trigger Property="IsPressed" Value="True">
                                                                            <Setter Property="Fill" TargetName="ArrowPath" Value="#FF9199A4"/>
                                                                        </Trigger>
                                                                        <Trigger Property="IsMouseOver" Value="True">
                                                                            <Setter Property="Fill" TargetName="ArrowPath" Value="#FF9199A4"/>
                                                                        </Trigger>
                                                                        <Trigger Property="IsEnabled" Value="False">
                                                                            <Setter Property="Fill" TargetName="ArrowPath" Value="#599199A4"/>
                                                                        </Trigger>
                                                                    </ControlTemplate.Triggers>
                                                                </ControlTemplate>
                                                            </Setter.Value>
                                                        </Setter>
                                                    </Style>
                                                </RepeatButton.Style>
                                            </RepeatButton>
                                        </Grid>
                                        <Telerik_Windows_Controls_Calendar:TransitionPanel x:Name="TransitionPanel" ClipToBounds="True" Grid.Row="1">
                                            <Telerik_Windows_Controls_Primitives:RadUniformGrid x:Name="MonthViews" Columns="{TemplateBinding Columns}" Rows="{TemplateBinding Rows}"/>
                                            <Telerik_Windows_Controls_Primitives:RadUniformGrid x:Name="YearViews" Visibility="Collapsed" Columns="{TemplateBinding Columns}" Rows="{TemplateBinding Rows}"/>
                                            <Telerik_Windows_Controls_Primitives:RadUniformGrid x:Name="DecadeViews" Visibility="Collapsed" Columns="{TemplateBinding Columns}" Rows="{TemplateBinding Rows}"/>
                                            <Telerik_Windows_Controls_Primitives:RadUniformGrid x:Name="CenturyViews" Visibility="Collapsed" Columns="{TemplateBinding Columns}" Rows="{TemplateBinding Rows}"/>
                                        </Telerik_Windows_Controls_Calendar:TransitionPanel>
                                    </Grid>
                                </Border>
                                <Grid x:Name="DisabledVisual" Visibility="Collapsed">
                                    <Rectangle Fill="#99FFFFFF" Stretch="Fill" StrokeThickness="1" RadiusX="2" RadiusY="2"/>
                                </Grid>
                            </Grid>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsEnabled" Value="False">
                                    <Setter Property="Visibility" TargetName="DisabledVisual" Value="Visible"/>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="MonthViewPanel">
                    <Setter.Value>
                        <ItemsPanelTemplate>
                            <Telerik_Windows_Controls_Calendar:CalendarPanel VerticalAlignment="Stretch" IsItemsHost="True" Columns="8" FirstColumn="1" PreserveSpaceForCollapsedChildren="True" Rows="7"/>
                        </ItemsPanelTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="YearViewPanel">
                    <Setter.Value>
                        <ItemsPanelTemplate>
                            <Telerik_Windows_Controls_Calendar:CalendarPanel VerticalAlignment="Stretch" IsItemsHost="True" Columns="4" PreserveSpaceForCollapsedChildren="True" Rows="3"/>
                        </ItemsPanelTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="DecadeViewPanel">
                    <Setter.Value>
                        <ItemsPanelTemplate>
                            <Telerik_Windows_Controls_Calendar:CalendarPanel VerticalAlignment="Stretch" IsItemsHost="True" Columns="4" PreserveSpaceForCollapsedChildren="True" Rows="3"/>
                        </ItemsPanelTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="CenturyViewPanel">
                    <Setter.Value>
                        <ItemsPanelTemplate>
                            <Telerik_Windows_Controls_Calendar:CalendarPanel VerticalAlignment="Stretch" IsItemsHost="True" Columns="4" PreserveSpaceForCollapsedChildren="True" Rows="3"/>
                        </ItemsPanelTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="DayTemplate">
                    <Setter.Value>
                        <DataTemplate>
                            <TextBlock Text="{Binding Text}"/>
                        </DataTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="MonthTemplate">
                    <Setter.Value>
                        <DataTemplate>
                            <TextBlock Text="{Binding Text}"/>
                        </DataTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="DecadeTemplate">
                    <Setter.Value>
                        <DataTemplate>
                            <TextBlock Text="{Binding Text}"/>
                        </DataTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="YearTemplate">
                    <Setter.Value>
                        <DataTemplate>
                            <TextBlock Text="{Binding Text}"/>
                        </DataTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="MonthViewStyle">
                    <Setter.Value>
                        <Style TargetType="{x:Type Telerik_Windows_Controls_Calendar:CalendarView}">
                            <Setter Property="Template">
                                <Setter.Value>
                                    <ControlTemplate TargetType="{x:Type Telerik_Windows_Controls_Calendar:CalendarView}">
                                        <Grid>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="*"/>
                                            </Grid.RowDefinitions>
                                            <Border Visibility="{TemplateBinding HeaderVisibility}" Background="Transparent" BorderBrush="Transparent" BorderThickness="0,0,0,1"/>
                                            <ContentControl HorizontalAlignment="Center" Margin="0,2" Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}" Foreground="Black" Visibility="{TemplateBinding HeaderVisibility}"/>
                                            <Grid Grid.Row="1">
                                                <Grid.RowDefinitions>
                                                    <RowDefinition Height="*"/>
                                                    <RowDefinition Height="*"/>
                                                    <RowDefinition Height="*"/>
                                                    <RowDefinition Height="*"/>
                                                    <RowDefinition Height="*"/>
                                                    <RowDefinition Height="*"/>
                                                    <RowDefinition Height="*"/>
                                                </Grid.RowDefinitions>
                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition Width="*"/>
                                                    <ColumnDefinition Width="7*"/>
                                                </Grid.ColumnDefinitions>
                                                <Border Grid.RowSpan="7" Background="#FFD2D4DA">
                                                    <Border.Visibility>
                                                        <Binding Path="HideColumn" Mode="TwoWay" RelativeSource="{RelativeSource TemplatedParent}">
                                                            <Binding.Converter>
                                                                <telerik:InvertedBooleanToVisibilityConverter/>
                                                            </Binding.Converter>
                                                        </Binding>
                                                    </Border.Visibility>
                                                </Border>
                                                <Border Grid.ColumnSpan="2" Background="#FFD2D4DA" BorderBrush="#FF9199A4" BorderThickness="0,0,0,1">
                                                    <Border.Visibility>
                                                        <Binding Path="HideRow" Mode="TwoWay" RelativeSource="{RelativeSource TemplatedParent}">
                                                            <Binding.Converter>
                                                                <telerik:InvertedBooleanToVisibilityConverter/>
                                                            </Binding.Converter>
                                                        </Binding>
                                                    </Border.Visibility>
                                                </Border>
                                            </Grid>
                                            <ItemsPresenter Grid.Row="1"/>
                                        </Grid>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Margin" Value="0"/>
                            <Setter Property="MinHeight" Value="150"/>
                            <Setter Property="MinWidth" Value="240"/>
                        </Style>
                    </Setter.Value>
                </Setter>
                <Setter Property="YearViewStyle">
                    <Setter.Value>
                        <Style TargetType="{x:Type Telerik_Windows_Controls_Calendar:CalendarView}">
                            <Setter Property="Template">
                                <Setter.Value>
                                    <ControlTemplate TargetType="{x:Type Telerik_Windows_Controls_Calendar:CalendarView}">
                                        <Grid>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="*"/>
                                            </Grid.RowDefinitions>
                                            <Border Visibility="{TemplateBinding HeaderVisibility}" Background="Transparent" BorderBrush="Transparent" BorderThickness="0,0,0,1"/>
                                            <ContentControl HorizontalAlignment="Center" Margin="0,2" Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}" Foreground="Black" Visibility="{TemplateBinding HeaderVisibility}"/>
                                            <Grid Grid.Row="1">
                                                <Grid.RowDefinitions>
                                                    <RowDefinition Height="*"/>
                                                    <RowDefinition Height="*"/>
                                                    <RowDefinition Height="*"/>
                                                </Grid.RowDefinitions>
                                                <Rectangle Grid.Row="0"/>
                                                <Rectangle Grid.Row="2"/>
                                            </Grid>
                                            <ItemsPresenter Grid.Row="1"/>
                                        </Grid>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Margin" Value="0"/>
                            <Setter Property="MinHeight" Value="150"/>
                            <Setter Property="MinWidth" Value="240"/>
                        </Style>
                    </Setter.Value>
                </Setter>
                <Setter Property="DecadeViewStyle">
                    <Setter.Value>
                        <Style TargetType="{x:Type Telerik_Windows_Controls_Calendar:CalendarView}">
                            <Setter Property="Template">
                                <Setter.Value>
                                    <ControlTemplate TargetType="{x:Type Telerik_Windows_Controls_Calendar:CalendarView}">
                                        <Grid>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="*"/>
                                            </Grid.RowDefinitions>
                                            <Border Visibility="{TemplateBinding HeaderVisibility}" Background="Transparent" BorderBrush="Transparent" BorderThickness="0,0,0,1"/>
                                            <ContentControl HorizontalAlignment="Center" Margin="0,2" Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}" Foreground="Black" Visibility="{TemplateBinding HeaderVisibility}"/>
                                            <Grid Grid.Row="1">
                                                <Grid.RowDefinitions>
                                                    <RowDefinition Height="*"/>
                                                    <RowDefinition Height="*"/>
                                                    <RowDefinition Height="*"/>
                                                </Grid.RowDefinitions>
                                                <Rectangle Grid.Row="0"/>
                                                <Rectangle Grid.Row="2"/>
                                            </Grid>
                                            <ItemsPresenter Grid.Row="1"/>
                                        </Grid>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Margin" Value="0"/>
                            <Setter Property="MinHeight" Value="150"/>
                            <Setter Property="MinWidth" Value="240"/>
                        </Style>
                    </Setter.Value>
                </Setter>
                <Setter Property="CenturyViewStyle">
                    <Setter.Value>
                        <Style TargetType="{x:Type Telerik_Windows_Controls_Calendar:CalendarView}">
                            <Setter Property="Template">
                                <Setter.Value>
                                    <ControlTemplate TargetType="{x:Type Telerik_Windows_Controls_Calendar:CalendarView}">
                                        <Grid>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition Height="*"/>
                                            </Grid.RowDefinitions>
                                            <Border Visibility="{TemplateBinding HeaderVisibility}" Background="Transparent" BorderBrush="Transparent" BorderThickness="0,0,0,1"/>
                                            <ContentControl HorizontalAlignment="Center" Margin="0,2" Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}" Foreground="Black" Visibility="{TemplateBinding HeaderVisibility}"/>
                                            <Grid Grid.Row="1">
                                                <Grid.RowDefinitions>
                                                    <RowDefinition Height="*"/>
                                                    <RowDefinition Height="*"/>
                                                    <RowDefinition Height="*"/>
                                                </Grid.RowDefinitions>
                                                <Rectangle Grid.Row="0"/>
                                                <Rectangle Grid.Row="2"/>
                                            </Grid>
                                            <ItemsPresenter Grid.Row="1"/>
                                        </Grid>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Margin" Value="0"/>
                            <Setter Property="MinHeight" Value="150"/>
                            <Setter Property="MinWidth" Value="240"/>
                        </Style>
                    </Setter.Value>
                </Setter>
                <Setter Property="Background" Value="#FFF0F1F2"/>
                <Setter Property="BorderBrush">
                    <Setter.Value>
                        <LinearGradientBrush EndPoint="0.714,1.292" StartPoint="0.318,0.068">
                            <GradientStop Color="#FFDBDCDE" Offset="0.39079609253679837"/>
                            <GradientStop Color="#FFC6C7C8" Offset="1"/>
                        </LinearGradientBrush>
                    </Setter.Value>
                </Setter>
                <Setter Property="BorderThickness" Value="1"/>
                <Setter Property="Padding" Value="10,12,10,7"/>
                <Setter Property="IsEnabled" Value="True"/>
                <Setter Property="ViewsHeaderVisibility" Value="Collapsed"/>
            </Style>
        </Window.Resources>
     
        <Grid>
            <telerikInput:RadDatePicker Width="120" Height="22" Style="{DynamicResource RadDatePickerStyle}" />
        </Grid>
    </Window>

    My errors look like this

    Error 1 The member "AreWeekNamesVisible" is not recognized or is not accessible. TelerikGridView\TelerikGridView\Window1.xaml 188 194 TelerikGridView
    Error 2 The member "AreWeekNumbersVisible" is not recognized or is not accessible. TelerikGridView\TelerikGridView\Window1.xaml 188 254 TelerikGridView
    Error 3 The member "CalendarWeekRule" is not recognized or is not accessible. TelerikGridView\TelerikGridView\Window1.xaml 188 318 TelerikGridView
    Error 4 The member "CenturyViewHeaderFormat" is not recognized or is not accessible. TelerikGridView\TelerikGridView\Window1.xaml 188 372 TelerikGridView
    Error 5 The member "CenturyViewPanel" is not recognized or is not accessible. TelerikGridView\TelerikGridView\Window1.xaml 188 440 TelerikGridView
    Error 6 The member "CenturyViewStyle" is not recognized or is not accessible. TelerikGridView\TelerikGridView\Window1.xaml 188 494 TelerikGridView
    Error 7 The member "Columns" is not recognized or is not accessible. C:\Users\Tigran Petrosyan\Desktop\TelerikGridView\TelerikGridView\Window1.xaml 188 548 TelerikGridView
    Error 8 The member "DayButtonStyle" is not recognized or is not accessible. TelerikGridView\TelerikGridView\Window1.xaml 188 620 TelerikGridView
    Error 9 The member "DayButtonStyleSelector" is not recognized or is not accessible. TelerikGridView\TelerikGridView\Window1.xaml 188 670 TelerikGridView
    Error 10 The member "DayTemplate" is not recognized or is not accessible. TelerikGridView\TelerikGridView\Window1.xaml 188 736 TelerikGridView
    TelerikGridView\TelerikGridView\Window1.xaml 188 780 TelerikGridView
    ..............
    ..............
  2. Masha
    Admin
    Masha avatar
    355 posts

    Posted 23 Sep 2014 Link to this post

    Hello Tigran,

    It seems that the provided xaml is outdated and that is the reason for the multiple errors at your side.

    We ship all the Styles and control templates inside Themes.Implicit folders of your personal installation.
    For RadDatePicker, go to Telerik.Windows.Controls.Input.xaml file of desired theme and search for RadDateTimePicker- this is the default style for the RadDateTimePicker control.

    I recommend you to use Implicit styling approach for customizing Telerik controls. This way you can make any modifications of the ControlTemplates more easily as you do not need to copy all the resources referenced in these templates.

    Hope this helps.



    Regards,
    Masha
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Tigran
    Tigran avatar
    16 posts
    Member since:
    Jul 2014

    Posted 23 Sep 2014 in reply to Masha Link to this post

    Hi Masha,

    Thank you for response ! I had tried before to solve my problem using implicit styling but it also had occured errors. But I have just fixed and now everything works OK.
Back to Top