How do I display MM/dd/yyyy (no time) in my DataGridView column?

后端 未结 7 476
臣服心动
臣服心动 2021-01-15 18:41

I need help on my DataGridView column date format. I want the date to be \"MM/dd/yyyy\". I dont need the time.

How can this be done programmatically?

7条回答
  •  被撕碎了的回忆
    2021-01-15 19:35

    After you set the DataSource of the DataGridView, set the desired format of the column:

    dataGridView1.Columns["dateReceived"].DefaultCellStyle.Format = "MM/dd/yyyy";
    

提交回复
热议问题