Show time only if it is provided

2 posts, 0 answers
  1. Inger Marie
    Inger Marie avatar
    60 posts
    Member since:
    Nov 2010

    Posted 02 Feb 2012 Link to this post

    I am working on a program with a lot of difficult users (who doesn't ;-)

    In my program, there is a worklist with a column containing next contact date (time is optional). This is a RadDateTimePicker.

    Some of my users wants to be able to input time and others wants to be able to input only dates. The latter group of users complains that the time part ('00:00') makes i harder to read the date.

    Is there a way to make RadDateTimePicker show only the date part, if no time-part has been entered?

    I work in a multi-cultural environment, I cannot use stuff like "{0:HH:mm}, but I do use stuff like {0:d}

    Thanks
  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 07 Feb 2012 Link to this post

    Hi Inger,

    In order to achieve this, you should switch the InputMode property of the DateTimePicker. I've attached an example which demonstrates how to bind it in the ViewModel and update it by clicking a button. In your real project you can switch it according to your requirements.

    Hope this helps.

    All the best,
    Yana
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top