Number Format For Datagridview in C#

前端 未结 4 2027
感情败类
感情败类 2020-12-21 05:11

I want to set the datagridview values in number format. Currently I am getting this:

\"enter

4条回答
  •  眼角桃花
    2020-12-21 06:04

    Goto your Form's Design mode then goto the properties of dgvmain there check DefaultCellStyle and set the format as you like.

    OR

    you can do this

    dgvmain.Columns["Amount"].DefaultCellStyle.Format = "N2";

    :)

提交回复
热议问题