Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
469
MaskInput "yyyymmdd" on DateTime column
posted

Hi,

I am trying to display and let users edit dates as "yyyymmdd" in a DateTime column. For some reason this does not work (e.g. 20081011 is shown correctly but when entering edit it changes to y08y1011).

I have noticed that adding literals as "/" or "-" make it work. Is there anyway to get this working?

This sample code reproduces this behaviour

DataTable dt = new DataTable();
dt.Columns.Add("dateColumn", typeof(DateTime));
dt.Rows.Add(DateTime.Now);
ultraGrid1.DataSource = dt;
ultraGrid1.DisplayLayout.Bands[0].Columns["dateColumn"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Edit;
ultraGrid1.DisplayLayout.Bands[0].Columns["dateColumn"].Format = "yyyyMMdd";
ultraGrid1.DisplayLayout.Bands[0].Columns["dateColumn"].MaskInput = "yyyymmdd";
ultraGrid1.DisplayLayout.Bands[0].Columns["dateColumn"].UseEditorMaskSettings = true;

Thanks,

Javier