I know this sounds silly, but no matter what I do when I pull data into a masked text box on the grid it ignores my mask.
I have a grid, radGridview1. My data is stored in the database as string data.
I am adding the column in code:
GridViewMaskBoxColumn maskBoxColumn =
new
GridViewMaskBoxColumn();
maskBoxColumn.Name =
"Phone"
;
maskBoxColumn.FieldName =
"cellphone_number"
;
maskBoxColumn.HeaderText =
"Phone"
;
maskBoxColumn.MaskType = MaskType.Numeric;
maskBoxColumn.Mask =
"(999) 000-0000"
;
maskBoxColumn.TextAlignment = ContentAlignment.BottomRight;
radGridView1.MasterTemplate.Columns.Add(maskBoxColumn);
Then in the CellFormating event:
if
(e.Column.Name==
"Phone"
)
{
long
cellInfo =Convert.ToInt64(e.CellElement.Value);
e.CellElement.Value = cellInfo;
}
In the debugger it stops on this line fine, I can confirm that cellInfo has the phone number stored in it (6185551212) say.
But in the cell it ignores the mask.
I have tried using type of standard and numeric. I have created columns in the columns editor.
I attached a picture of what it is doing.
Any thoughts?
Thanks,
Joe