Number Format For Datagridview in C#

前端 未结 4 2034
感情败类
感情败类 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 05:50

    You have to spot, that all the data on your first screenshot are left aligned.

    The formatting you try, and the others adviced are good. I must note, DefaultCellStyle most be used before you add columns to the grid. The case, that it seems specified formats does not work, tells me your data type may be string, not numeric.

提交回复
热议问题