Results 1 to 4 of 4

Thread: formatting datagridview

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2006
    Posts
    176

    formatting datagridview

    Hi All.
    DGV column Contact has value email address and phones. Is it possiable to format that column if email address it will like regular string and if phone number it will formating like (###) ###-####.
    Thanks.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: formatting datagridview

    Don't post the same question multiple times.

    http://www.vbforums.com/showthread.php?t=520251
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Nov 2006
    Posts
    176

    Re: formatting datagridview

    Hi jmcilhinney
    Thanks for replay. Problem formatting ony phone data in datagridview I sold. In that post I'm would like to know if in datagridview same column hold information such as phone and email address how to format that phone data will formatting like (xxx) xxx-xxxx and email address data will look like email address. Is it possiable formatting phone and email at same column?
    Thanks.

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: formatting datagridview

    I didn't realise you meant the same column. I'm not sure it's a good idea, but if that's what you want to do then you should be able to just handle the CellValueChanged event, test whether the value is an Integer or not and, if it is, apply the phone number format string by setting the cell's Style.Format property.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width