Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 94857

gridview masked text box seems broken

$
0
0

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 = newGridViewMaskBoxColumn();
            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")
         {
             longcellInfo =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

 

 


Viewing all articles
Browse latest Browse all 94857

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>