How can I display a 9 digit zipcode in a Datagrid with a hypen

Discussion in 'ASP .Net Web Controls' started by Jeff Thur, Feb 17, 2005.

  1. Jeff Thur

    Jeff Thur Guest

    The ZipCode column in my database is a 9 digit code with
    no hypen between position 5 and 6 (eg: 123456789) I need
    the user to see the results in the datagrid as 12345-
    6789. How can this be accomplished. Thanks for any help.
     
    Jeff Thur, Feb 17, 2005
    #1
    1. Advertising

  2. handler the itemdatabound event, find the cell and either apply a regular
    expression to the text or insert a hyphen at the specified position

    --
    Regards,
    Alvin Bruney [Microsoft MVP ASP.NET]

    [Shameless Author plug]
    The Microsoft Office Web Components Black Book with .NET
    Now Available @ http://www.lulu.com/owc
    ----------------------------------------------------------


    "Jeff Thur" <> wrote in message
    news:270c01c514c9$19c0e0a0$...
    > The ZipCode column in my database is a 9 digit code with
    > no hypen between position 5 and 6 (eg: 123456789) I need
    > the user to see the results in the datagrid as 12345-
    > 6789. How can this be accomplished. Thanks for any help.
     
    Alvin Bruney [MVP], Feb 17, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Fangs
    Replies:
    3
    Views:
    9,799
    darshana
    Oct 26, 2008
  2. DaveF

    ZIPCODE DB ACCESS TO SQL

    DaveF, Sep 29, 2004, in forum: ASP .Net
    Replies:
    6
    Views:
    428
    Scott M.
    Sep 30, 2004
  3. Jeff Thur

    Need to Format a zipcode into xxxxx-xxxx.

    Jeff Thur, Feb 18, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    186
  4. Irishmaninusa

    Canada ZipCode Finder

    Irishmaninusa, Aug 18, 2003, in forum: ASP General
    Replies:
    1
    Views:
    122
    Aaron Bertrand - MVP
    Aug 18, 2003
  5. William Morris

    Zipcode lookup by proximity...

    William Morris, Jun 9, 2004, in forum: ASP General
    Replies:
    8
    Views:
    196
    Aaron [SQL Server MVP]
    Jun 11, 2004
Loading...

Share This Page