Format TimeSpan in DataGridView column

前端 未结 5 1519
梦毁少年i
梦毁少年i 2020-12-16 22:27

I\'ve seen these questions but both involve methods that aren\'t available in the CellStyle Format value. I only want to show the hours and minutes portion (16:05); not the

5条回答
  •  半阙折子戏
    2020-12-16 23:02

    Try the following code

    dataGridView1.Columns["columnName"].DefaultCellStyle.Format = "hh\\:mm";
    

提交回复
热议问题