Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
140
Phone Number - Cell Display
posted

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.

Parents
  • 71886
    Verified Answer
    Offline posted

    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.

     

Reply Children
No Data