0
I have an application in wpf, so there are windows that have fields for date types, I put these fields with datepicker in which there is a calendar for choosing the date.
So far so good, what I could not put is a mask to look like this "00/00/0000" in this field, accepting only numbers.
Does anyone have any idea what I can do?
<Datepicker Name="datepickerData" Horizontalalignment="Left" Margin="421,128,0,0" Verticalalignment="Top" Height="31" Width="128" Mouseleftbuttondown="datepickerData_MouseLeftButtonDown"/> I have it Fabio, I put it inside?
– jp_almeida
<Datepicker Horizontalalignment="Left" Displaydate="{x:Static System:Datetime.Now}" Selecteddate="{Binding Path=Data, Stringformat='{}{0:dd.MM.yyyy}'}" Margin="139,58,0,0" Verticalalignment="Top" Width="120"/>
– Fabio Kobuti
Try this above, I’m off my windows pc... but this should suit.
– Fabio Kobuti
Error 1 Unknown build error, 'Key cannot be null. Parameter name: key Line 114 Position 88. ' gives asim error. Does not accept x: Static System:Datetime.Now
– jp_almeida
Sorry, I made an error, the property you have to apply the mask, is the Displaydate, not selectedDate <Datepicker Horizontalalignment="Left" Displaydate="{Binding PROPRIEDADE_DATA, Stringformat='{}{0:dd.MM.yyyy}'}" Selecteddate="{Binding Path=Data}" Margin="139,58,0,0" Verticalalignment="Top"
– Fabio Kobuti
PROPRIEDADE_DATA what it would be?
– jp_almeida
Your property will be selected. For example, in your data model, you have something of the Date type selected... Then you would put this
– Fabio Kobuti