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
1339
DateTime masked edit zero fills on character delete
posted

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).

Parents
  • 469350
    Offline posted

    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.

Reply Children