How do you show a formatted phone number in a wingrid cell at all times?
The data comes from the database as: 1234567890
I want both the cell display and mask display to be like (###) ###-####. The mask display works but the cell display does not work no matter what I try. The data in the database can be any data type needed like an integer, string, etc to make this work.
Hello Jason,
I was able to achieve this by setting the datatype of the column ot System.Int64 and using the following code for the WinGrid control:
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { e.Layout.Bands[0].Columns[0].MaskInput = "(###) ###-####"; e.Layout.Bands[0].Columns[0].Format = "(###) ###-####"; }
Please do not hesitate to contact me if you need any additional assistance.
You could also acheive the same thing like so:
band.Columns["String 1"].MaskInput = "(###) ###-####";band.Columns["String 1"].MaskDisplayMode = Infragistics.Win.UltraWinMaskedEdit.MaskMode.IncludeBoth;
I tried this out using a string field to store the data instead of Int64 and it works pretty much the same way.