Datagrid Format Question

Discussion in 'ASP .Net' started by aaapaul, Mar 1, 2006.

  1. aaapaul

    aaapaul Guest

    Hello !

    I have a Datagrid with .AutoGenerateColumns = True

    Colums 1 to X should have the same format.

    In which event can I set the format ?

    For i = 0 to dg.columns.count -1
    dg.columns(i).dataformatstring = "{0:#,##0}"
    next

    Thanks
    aaapaul
     
    aaapaul, Mar 1, 2006
    #1
    1. Advertising

  2. The only event where you can catch autogenerated columns is ItemCreated.
    Don't use Columns property, the event will be called once for every item.

    Eliyahu

    "aaapaul" <> wrote in message
    news:...
    > Hello !
    >
    > I have a Datagrid with .AutoGenerateColumns = True
    >
    > Colums 1 to X should have the same format.
    >
    > In which event can I set the format ?
    >
    > For i = 0 to dg.columns.count -1
    > dg.columns(i).dataformatstring = "{0:#,##0}"
    > next
    >
    > Thanks
    > aaapaul
    >
     
    Eliyahu Goldin, Mar 2, 2006
    #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. Brian Candy
    Replies:
    2
    Views:
    1,205
    Janaka
    Feb 18, 2004
  2. Andy
    Replies:
    7
    Views:
    6,329
    Roedy Green
    May 10, 2004
  3. shannon
    Replies:
    1
    Views:
    8,647
  4. shannon
    Replies:
    0
    Views:
    590
    shannon
    Feb 1, 2006
  5. Replies:
    6
    Views:
    480
    Thomas Ganss
    Jan 15, 2006
Loading...

Share This Page