Format DataGridView cell display format in a Window form

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
 
C

Chris Shepherd

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top