Format and Input Date in a DataGridView

SteveInBeloit

Well-known member
Joined
May 22, 2006
Messages
132
Programming Experience
10+
Hello,
I have a column in a DataGridView thats source is from a DateTime column on the database.

I want the users to see : mm/dd hh:mm am (actually am or pm)

I want them to be able to edit this column using the same format.

I am having a little trouble getting this to work. I have been trying the Format function, but I must not be putting it in the right place or something.

Thanks
 
Roundtripping this custom format will likely fail, because it doesnt contain enough information to complete the trip from date to string and back again.

I would recommend instead that you see this article:

http://msdn2.microsoft.com/en-us/library/7tas5c80.aspx

And use a datetimepicker formatted appropriately for showing and editing the date because it has a better knowledge of date objects than something simplistic like a text box
 
Back
Top