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. Advertisements

  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. Advertisements

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,429
    Janaka
    Feb 18, 2004
  2. =?Utf-8?B?Tkg=?=

    quick datagrid format question

    =?Utf-8?B?Tkg=?=, May 20, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    512
    =?Utf-8?B?RWx0b24gVw==?=
    May 24, 2005
  3. Andy
    Replies:
    7
    Views:
    6,618
    Roedy Green
    May 10, 2004
  4. shannon
    Replies:
    1
    Views:
    8,821
  5. shannon
    Replies:
    0
    Views:
    703
    shannon
    Feb 1, 2006
  6. Replies:
    6
    Views:
    721
    Thomas Ganss
    Jan 15, 2006
  7. Chu
    Replies:
    3
    Views:
    4,476
    Shawn
    Aug 15, 2006
  8. ibeetb

    datagrid format question

    ibeetb, Jul 14, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    186
    Rick Spiewak
    Jul 15, 2004
Loading...