Set the DateTimeWatermarkContent based on the IsEnabled property

2 posts, 0 answers
  1. Martin
    Martin avatar
    28 posts
    Member since:
    Nov 2019

    Posted 30 Apr 2020 Link to this post

    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?

  2. Vladimir Stoyanov
    Vladimir Stoyanov avatar
    764 posts

    Posted 05 May 2020 Link to this post

    Hello Martin,

    You can achieve the described requirement with the following approach:

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

    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.

    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.
Back to Top