Formatting a Cell within a GridView

I want to format a cell within a Gridview for currency....Like I have a cost column and I want that column to be in the format of money like $300.00 but in my Gridview is there a way i can format the cell for this


Answer this question

Formatting a Cell within a GridView

  • globelin

    You would expect

    DataGridView1.Columns(0).DefaultCellStyle.Format = "C2"

    to work but it doesn't. However if you also add

    DataGridView1.Columns(0).ValueType = GetType(System.Double)

    you should find it works ok.


  • Formatting a Cell within a GridView