I am trying to format an Australian phone number with the UltraMaskedEdit control in the following way
nnnn nnn nnn
9999 999 999
#### ### ###
I can input using any of these input masks, but the phone numbers in Australia have leading zeroes i.e. 0419 999 999. Since the user must dial the zero, I need the leading zero to be displayed.
How can I input this number and not have the data in the control shift left because of the leading zero? The data is defined as a numeric with 11 digits total.
Keep in mind that the application must also store U.S. phone numbers also.
Thanks
Larry Burns
I guess no one monitors these forums! :(
I have figured out what I need to do. So no help is needed.
Hi Larry,
My guess is that you probably need to adjust the MaskDisplayMode and tell it to include literals and padding.
With e.Layout.Bands(0)
.Columns("ssn").Format = "###-##-####"
.Columns("ssn").CellAppearance.TextHAlign = HAlign.Right
.Columns("phone1").MaskInput = "9999 999 999"
.Columns("phone1").Format = "9999 999 999"
With .Columns("Phone1")
.MaskDataMode = Infragistics.Win.UltraWinMaskedEdit.MaskMode.IncludeLiteralsWithPadding
.MaskClipMode = Infragistics.Win.UltraWinMaskedEdit.MaskMode.IncludeLiteralsWithPadding
.MaskDisplayMode = Infragistics.Win.UltraWinMaskedEdit.MaskMode.IncludeLiteralsWithPadding
End With
Hi,
Your original post was referring to the UltraMaskedEdit control, but now you seem to be referring to a WinGrid column.
Are you still unable to get this to work?
What's the data type of the column?
Mike,
Sorry about that! Yes I switched gears on you. The data was a numeric in SQL Server. In order to display the leading zero using 9999 999 999 (Australian phone numbers), I had to change the column to a string and format worked for the maskededit control.
The issue now is displaying those same numbers in a grid using the format. The last post shows what I am doing with format for both a SSN and those phone numbers. Neither will display properly with any format or maskinput properties I set.
FYI: The SSN is a numeric with 9 digits.
Any suggestions?