DataGridView Custom format for phone number


hello everyone!  trying phone number custom format column in datagridview, nothing try works!  ideas on how fix this?  here's code:

        private void tbl_alunosdatagridview_cellformatting(object sender, datagridviewcellformattingeventargs e)
        {
            try
            {
                this.tbl_alunosdatagridview.columns["telfixo"].defaultcellstyle.format = "(##) ####-####";
                this.tbl_alunosdatagridview.columns["telcelular"].defaultcellstyle.format = "(##) #####-####";
            }
            catch (exception)
            {
            }
        }


jcrcarmo

problem solved !!!

alll had change type of phone number fields int double on database , vs2015 built-in custom format works perfectly!  easier thought.  :d


jcrcarmo



Visual Studio Languages  ,  .NET Framework  >  Visual C#



Comments

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

How to fix error Msg 1801, Level 16, State 3, Line 1

How to Share webservice object to all user