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

bug: InputMode="DatePicker" when DateTimeText binding c# DateTime still show time

1 Answer 95 Views
DateTimePicker
This is a migrated thread and some comments may be shown as answers.
Missing User
Missing User asked on 24 Jan 2013, 02:32 AM
in demo, set inputMode to DatePicker, it will show date only, but when binding DateTimeText to a c# DateTime value , the inputmode will auto change to DateTimePicker. I think it is a bug.

1 Answer, 1 is accepted

Sort by
0
Georgi
Telerik team
answered on 25 Jan 2013, 03:15 PM
Hello Hui,

As DateTimeText is a string property it seems like when DateTime is converted to the string the time is also converted. So what you can try is using StringFormat when you convert the DateTime to string and hide the time.
Also you can manipulete the CultureInfo for example:
CultureInfo info = new System.Globalization.CultureInfo("en-US");
           info.DateTimeFormat.LongDatePattern = "M/d/yy";
           dateTimePicker.Culture = info;

Nevertheless if you don't need specifically to use the DateTimeText you can use SelectedValue.
If you have any troubles with implementing one of the above suggestions it would be best if you can send us more info about your scenario so we would be able to provide you with more detailed help.



Kind regards,
Georgi
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
DateTimePicker
Asked by
Missing User
Answers by
Georgi
Telerik team
Share this question
or