1/1/1800 default value


Author
Message
Keith Chisarik
Keith Chisarik
StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
I know this is the default value show for a date field, I was OK with that since my customer told me that upon initial data entry all date fields would have "real" values put into them. This turned out to not be the case so I have a website displaying a bunch of 1800 dates to end users Sad



My question is this, is there any quick and dirty way you can think of to either not show the date in the textbox if it is 1/1/1800? Heck I dont even care of the textbox itself doesnt show. I would like to accomplish this with only code changes and not changes to the database and BO's.



Help as always appreciated.







Keith




Keith Chisarik
Attachments
dates.jpg (252 views, 24.00 KB)
Reply
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
You could accomplish this several ways.  First, since this is a web page, you could hide the text boxes on the page Load event if the dates are 1/1/1800.

MyText.Visible = MyBO.MyDate.Year <> 1800

If you have any 3rd party web controls such as Infragistics that have a web based date time control, you can also set the "NULL" value to be 1/1/1800 which would show an empty field.

Last, you could create your own text box which and implement your own data binding and NULL value support.  The NULL value in this case would be 1/1/1800 which you could then return an empty string when displaying the control.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search