Hi,
I need to enter a time in the format hhhh:mm to be entered into i a grid.
I tried setting the MaskInput Property of the Column to "nnnn:nn" entering the time works fine, but as soon as the AfterCellUpdate is fired the value is set to hhhhmm without the ":". I need the Value as a String.
Is there any way to accomplish this
Edit: The Grid is databound so i cant set the type property and I tried setting a format too without succeeding
I was going to test this out but I don't have enough information.
What's the DataType of the column?
You probably need to set the MaskDataMode on the column and tell it to include the literals.
You might also want to take a look at MaskClipMode and MaskDisplayMode.
Thanks for the Advice it could be done by setting the MaskDisplay- and MaskDataMode to MaskMode.IncludeLiterals.
So if anyone has a similar Problem here is what I did:
column.MaskInput = "nnnn:nn";
column.MaskDisplayMode = Infragistics.Win.UltraWinMaskedEdit.MaskMode.IncludeLiterals;
column.MaskDataMode = Infragistics.Win.UltraWinMaskedEdit.MaskMode.IncludeLiterals;
I tried to use the Mask "nnn#:##" but it wasn't possible to enter the time the way i liked (from right to left) so i just used a check in the Leave Event
Thanks
I thought I was over this but a change request just came in.
The mask has to be changed to a simple time format hh:mm. The problem is that it has to be possible to enter negative times to. Since the "-" only works with "n" i tried "{LOC}-nn:nn" (that the minute block could be greater than 60 is not a problem since i check it anyway) but when i enter 00:00 I cant get past the ":" which is strage. The Column is a simple string type. Strange thing is when i use "99:99" as a mask it works just fine but i cant get negative values. The only way this worked was entering "{LOC}-n99:99" as mask. This works but when i enter a value (defualt is 0:00) it looks just ugly 0__:00.
Is there any way to hide the padding or a better mask?