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

Set the DateTimeWatermarkContent based on the IsEnabled property

1 Answer 68 Views
DateTimePicker
This is a migrated thread and some comments may be shown as answers.
Martin
Top achievements
Rank 1
Veteran
Martin asked on 30 Apr 2020, 11:30 AM

As the title suggest, my question is if it is possible to set the DateTimeWatermarkContent of the DateTimePicker control based on if the DatePicker is enabled or not. 

More specifically what I want to do is to remove the DateTimeWatermarkContent text when the control is disalbled.

How would I go about doing that?

1 Answer, 1 is accepted

Sort by
0
Vladimir Stoyanov
Telerik team
answered on 05 May 2020, 06:52 AM

Hello Martin,

You can achieve the described requirement with the following approach:

<Style TargetType="telerik:RadDateTimePicker" >
            <Setter Property="DateTimeWatermarkContent" Value="Test" />
            <Style.Triggers>
                <Trigger Property="IsEnabled" Value="False">
                    <Setter Property="DateTimeWatermarkContent" Value="" />
                </Trigger>
            </Style.Triggers>
        </Style>

Note, that if you are using the NoXaml dlls, you have to base the style on the default one for the theme.

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.
Tags
DateTimePicker
Asked by
Martin
Top achievements
Rank 1
Veteran
Answers by
Vladimir Stoyanov
Telerik team
Share this question
or