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

Show time only if it is provided

1 Answer 45 Views
DateTimePicker
This is a migrated thread and some comments may be shown as answers.
Inger Marie
Top achievements
Rank 1
Inger Marie asked on 02 Feb 2012, 01:24 PM
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

1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 07 Feb 2012, 12:27 PM
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 >>
Tags
DateTimePicker
Asked by
Inger Marie
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or