Hi,
i have this code:
ug.DisplayLayout.Bands(0).Columns("col1").Style = ColumnStyle.Date
ug.DisplayLayout.Bands(0).Columns("col1").Format = "yyyyMMdd"
ug.DisplayLayout.Bands(0).Columns("col1").MaskInput = "yyyymmdd"
ug.DisplayLayout.Bands(0).Columns("col1").PromptChar = "_"c
Now, i can choose a date with the button on the right and after that the date is formed as in .Format defined (=correct).
But the user should also be able to type the date in format yyyymmdd (e.g. "20170503") without any _ : or something.
But this doesn't work. When I click in the cell the date Looks like "y17y0503".
When i set maskinput= "yyyy mm dd" it works fine, but we don't want this. We want yyyymmdd.
How can i get this?
Thank you so much...
There's no way to do this, at least not when using masks. The Masked Editor does not support date masks with no separators. There has to be a separator character in between the date sections. So "yyyymmdd" is not a valid date mask.
So you have a few options:
1) Use a separator for your mask like "yyyy/mm/dd"
2) Don't use a masked editor. This is not a great solution since you would lose the DateTime dropdown. You could implement your own using a DropDownEditorButton, but that would require some additional coding to make it work properly - essentially re-inventing the existing editor.
Another info
When i set maskinput to "yymmdd" it Shows me "yy " and i cannot type anything
So, the problem is, we don't want space or anything between yyyy and mm and dd because when the user clicks into the cell, the Focus is not always in front to start with the year....
Another info:
i try maskinput="########" , this Looks good, but when you leave the cell, you get "Unable to update the data value: Value in Editor is not valid". GRRRR