Field formatting DateEdit devExpress Windows forms

0

I'm having a date formatting problem next to the date component dateEdit of devExpress . I need the field date formatted as follows: 01/01/2016. And when typing the values, go to the next character without typing the "/" to move to the other field (month / year). Another constraint is that this field must accept empty or null value.

Because when you clear the date field it puts a start date that is 01/01/0001, but you should keep __ / __ /

asked by anonymous 09.06.2016 / 20:42

1 answer

0

You need to modify the editing mask:

dateEdit1.Properties.Mask.Culture = new System.Globalization.CultureInfo("pt-BR");
dateEdit1.Properties.Mask.EditMask = "dd/MM/yyyy";
// como você usou 01/01/2016 não dá pra saber se é d/m ou m/d, mude para:
//dateEdit1.Properties.Mask.Culture = new System.Globalization.CultureInfo("en-US");
//dateEdit1.Properties.Mask.EditMask = "MM/dd/yyyy";         
dateEdit1.Properties.Mask.UseMaskAsDisplayFormat = true;
dateEdit1.Properties.CharacterCasing = CharacterCasing.Upper;

As for the null value, I can not reproduce this problem here on my machine. You may have modified NullDate , or changed AllowNullInput

    
19.10.2016 / 17:05