How to Display only DatePart in Wpf DateTimepicker?

Dispalying Date in Wpf DateTimepicker Control in mm/dd/yyyy format without time. Date Property is binding from view Model.

Answers


While binding your datetimepicker to viewmodel property you can specify the date format like

{Binding DateTimeProperty, StringFormat={}{0:dd/MM/yyyy}"

You can use SelectedDateFormat property.

 SelectedDateFormat="Short"

or

can use custom string format.

{Binding YourDateProperty, StringFormat={}{0:dd/MM/yyyy}"

Need Your Help

Simplify writing custom iterators in Java

c# java collections iterator yield-return

Writing iterators for custom collections in Java is quite complicated, because instead of writing straight-forward code that provides one element after the other, you essentially have to write a st...

“Bad value … for attribute name on element meta” errors for meta tags

html google-plus meta-tags w3c-validation

The Google+ JS API shows credentials and settings can be set using meta tags instead of passing through a JS call. Examples:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.