How to show the complete DateTime value in a Datagridview cell when it is exactly midnight?

I have a DataGridView with a column that holds DateTime values like this:

wild DataGridView named dgView

The problem is in the selected row: it actually has the value "10/07/2015 12:00:00 am" but in the datagridview it is shown only "10/07/2015". The next row has the value of "10/07/2015 12:00:26 am". This problem happens only when the hour of the DateTime values is exactly midnight. When I pass that value to a textBox (to the left) with the following code, DateTime value is shown correctly (DateTime values are in the column with index 2):

text1.Text = dgView.SelectedRows[0].Cells[2].Value.ToString();

How can I make my DataGridView to show the complete DateTime values? I do not want to set the DefaultCellStyle.Format value because I want to show the DateTimes in the format of the OS regional settings (in my case is es-pe).

I'm targeting .Net 3.5 compiled for x86.

Jon Skeet
people
quotationmark

You could specify the DefaultCellStyle.Format, but use a "standard format" which will localize appropriately:

DefaultCellStyle.Format = "g"; // General date, short time pattern

I don't know that that will format midnight "fully", but it's worth a try.

people

See more on this question at Stackoverflow