Datagridview DateTime Format not using System Region settings

Posted by Nick on Stack Overflow See other posts from Stack Overflow or by Nick
Published on 2010-06-02T02:35:40Z Indexed on 2010/06/02 2:43 UTC
Read the original article Hit count: 363

Filed under:
|
|

I've got a datagridview that is hooked up to a bindingsource on my main form. One of the columns and datamembers in the bindingsource is a DateTime object. When the datagridview shows this item it doesn't use Window's default region settings for displaying datetime.

The weird thing is, I can access this same DateTime object and print it to a text box, or even pass it off to another form with another datagridview and binding source and it actually shows up properly in that table.

So then, why does the datagridview on my main form not use the regional date/time settings when converting the DateTime object to a string?

I've checked that there was no special formatting applied to the datagridview and so I'm running out of ideas to check.

Do you guys know if there is any super secret way to get a datagridview to follow system regional format rules or not?

Also, since I highly doubt that I did something different with this datagridview vs the others in my application, the next potential area for issue could be on application load: Perhaps since this comes up when the application loads, it's not getting the same cultureUI settings as the other datagridviews?

Any Help?

© Stack Overflow or respective owner

Related posts about c#

Related posts about datagridview