StrataFrame Forum

Date column in datagridview

http://forum.strataframe.net/Topic26632.aspx

By Charles R Hankey - 3/25/2010

So many good reasons to either not use datagridviews for data entry or to use a 3rd party grid that has more capability BUT



Suppose I need to use a standard MS datagridview with a BBS.



I can set the format to d for a short date but in BO mapper I use either generic for nulls or #1/1/1800# for replace/value.



Either way, as soon as you enter a date field in grid you get 1/1/1800. Then if you enter an invalid date it throws an error.



Any tricks for using the datagridview? Ideally I'll like to have the datetimepicker in that column, but I'm a bit of an idiot as to how to build the grid manually if I do that and it seems pretty labor intensive since you can't just pick that as a control type for the column.



Suggestions? Doesn't have to be fancy, just user friendly for entering dates



( next time around I'll be using an infragistics grid where I think there are more options )



TIA
By Edhy Rijo - 3/25/2010

Hi Charles,



I love Google... The first link is the search I did, and the second one is one sample on how to add a DateTimePicker to the DataGridView, of course you would want to use the SF class for the DateTimePicker, I don't know if it will work, but it is a start.



http://www.google.com/search?q=vb.net+how+to+use+datetimepicker++in+datagridview&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a



http://www.vbdotnetforums.com/winforms-grids/17524-add-datetimepicker-datagridview.html
By Charles R Hankey - 3/25/2010

Edhy Thank you! You're a better googler than I am Smile



I googled around quite a bit and didn't hit that second link which is definitely what I'm looking for.


By Edhy Rijo - 3/25/2010

You are welcome Charles.



Well basically what I do with Google is I enter the following search expression:



"vb.net how to use datetimepicker in datagridview"




Also some times I go to the Google Microsoft page http://www.google.com/microsoft and to do my search.