I've been struggling to identify the source of some weird behavior when using a custom input mask on a DateTime backed column. I'm using a fairly typical date format as follows:
UltraGridColumn someDate = columns["SomeDate"];
someDate.MaskInput = "yyyy/mm/dd hh:mm:ss";
Now when editing this field, if you place the cursor between the 3rd and 4th digit of the year and hit the "delete" key, it properly deletes the last digit of the year but it sticks a zero in it's place. Since the zero is there you can't enter a new digit.
Pressing the delete key with the cursor in any other position within the entire datetime string does not have this issue (deletes properly and shows the blank '_' character of the mask and allows another digit to be entered).
Thanks! Any insight would be greatly appreciated!
(This is with version 2009.2).
Hi,
Which, if any, events on the UltraDateTimeEditor are you handling? It looks to me like something is causing the date to get committed and the control is automatically filling in the blank for some reason. But it would not do that unless something in the code triggered it - the Backspace key by itself would not be enough - or at least it shouldn't be.
If you are not hooking any events on the control, then I recommend that you see if this happens with a new UltraDateTimeEditor on a form in a new project with nothing else in it. That will at least tell us if this is a problem with the control or something that is being caused by some other factor in your application.
No events are being handled on the editor. I created a new project, threw an ultragrid on the form, gave it a single DateTime column, added a row to the autogen'd data source in the form's OnLoad method, and setup InitializeLayout as follows:
private void ultraGrid1_InitializeLayout(object sender, InitializeLayoutEventArgs e){ var band = e.Layout.Bands[0]; UltraGridColumn date = band.Columns["Column 0"]; date.MaskInput = "yyyy/mm/dd hh:mm:ss";}
Same behavior. Note that it is not the backspace key as you mentioned in your post, but the delete key. And only between the third and last digit of the year.
It also looks like the editor that is set by default (when checking the Editor property of the UltraGridColumn) is of type Infragistics.Win.DateTimeEditor, not UltraDateTimeEditor as you mention.
The specific version of UltraWinGrid.v9.2 we are using is 9.2.20092.2119.
Okay, I tried this out and I get the same behavior. I'm going to forward this thread over to Infragistics Developer Support so they can write it up for developer review.
rastedt said:It also looks like the editor that is set by default (when checking the Editor property of the UltraGridColumn) is of type Infragistics.Win.DateTimeEditor, not UltraDateTimeEditor as you mention.
DateTimeEditor is the editor. UltraDateTimeEditor is the control, which uses a DateTimeEditor. So they are basically the same thing. I tried this out using the UltraDateTimeEditor control and I the same results, so this is an issue with the editor.
It also seems like this only happens when the year is first. If I use "mm/dd/yyyy" it doesn't happen.
Mike Saltzman"]It also seems like this only happens when the year is first. If I use "mm/dd/yyyy" it doesn't happen.
Agreed. I only saw the issue with the yyyy/dd/mm format.
Thanks for the prompt replies!
Infragistics has addressed this issue in a service release of version 2010.3 (10.3.20103.2094, available 12 May 11).
Hello,
I have creates a support ticket for you with id CAS-62927-V9SZCG, in order toinvestigate this issue further for you.
Thank you.