Format DataGridView cell display format in a Window form

  • Thread starter Thread starter Ben
  • Start date Start date
B

Ben

I've a date field displayed at a DataGridView, and want to format it to
'yyyymmdd hh:mm:ss'. How would you do that?

Thanks,
Ben
 
Ben said:
I've a date field displayed at a DataGridView, and want to format it to
'yyyymmdd hh:mm:ss'. How would you do that?

Using the Format property on the column. If your columns are determined
at runtime by whatever you're loading in the grid, then you can access
the column via dataGridView1.Columns["columname"] and then set whatever
Format you want from there.

Chris.
 
Back
Top