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

Resource xaml for RadDatePicker

1 Answer 60 Views
DatePicker
This is a migrated thread and some comments may be shown as answers.
Frank
Top achievements
Rank 1
Frank asked on 06 Jul 2011, 01:40 PM
Hello,

im using Datepicker in RadGridView. Im going to write a Resource .xaml for all RadDatePickers. So that I have to change the property only in one .xaml if necessary. I tried this way:
 
<Setter Property="ErrorTooltipContent" Value="Error for Example">
           <DataTemplate>
                    <TextBlock Text="{Binding Path=ToolTipConten, ElementName=radDateTimePicker}"
                               FontWeight="Bold"
                               Foreground="Red"/>
                </DataTemplate>
           
        </Setter>


 But it doesnt work...Its the same with Watermarkcontent. How can I solve it?

Best regards
Christian

1 Answer, 1 is accepted

Sort by
0
Konstantina
Telerik team
answered on 11 Jul 2011, 04:52 PM
Hello Christian,

In order to set a DataTemplate to the WaterMark you need to apply it through the DateTimeWatermarkTemplate property, like so:

<Style x:Key="DatePickerStyle" TargetType="telerik:RadDateTimePicker">
           <Setter Property="DateTimeWatermarkTemplate">
               <Setter.Value>
                   <DataTemplate>
                       <TextBlock Text="WaterMarkText"
                              FontWeight="Bold"
                              Foreground="Red"/>
                   </DataTemplate>
               </Setter.Value>
           </Setter>
       </Style>

Also, in the DataTemplate binding with the ElementName set to the control is not supported, as it is in different namescope. Binding with ElementName can exist only if the name is inside the DataTemplate.
Unfortunately, there is no property to which the ErrorToolTip template can be set. You can only set the Content of the ErrorToolTip.

Hope this information helps.

Greetings,
Konstantina
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
DatePicker
Asked by
Frank
Top achievements
Rank 1
Answers by
Konstantina
Telerik team
Share this question
or