1/1/1800 default value


Author
Message
Keith Chisarik
Keith Chisarik
StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K 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 (240 views, 24.00 KB)
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K 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.

Keith Chisarik
Keith Chisarik
StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
that worked great thanks, so simple I feel silly for asking now.



I dont think this one is as easy...



I need to improve the visual formatting of a SF listview on a webpage.



I would like to center specific columns only, make some columns and the header text bold, and then shade the background of the header a different color. Can you point me in the right direction? I see 'headercssclass' but that was all i found and I don't know how to use it.



Thank you.





Keith Chisarik
Attachments
listview.jpg (211 views, 27.00 KB)
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
You can do this actually pretty easily.  Remember that the ListView is doing nothing more than creating an HTML table when it is all said and done.  You also have the same flexibility as the WinForms by using a population through an event rather than by the formated element.  When you populate through the RowPopulating event, you can test on your BO and add any HTML tags that you require.

A style sheet just makes these types of things easier so you can go back and make a single change rather than having to dig back into your code.  To see this in action, open up the Web Sample Application that comes with StrataFrame.  Go to the SearchCustomers.aspx page and there is a ListView on that page that uses the HeaderCssClass tag, CssClass tag, and populates one of the columns through the RowPopulating event.  I think that this will get you going in the right direction.

Keith Chisarik
Keith Chisarik
StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
awesome thanks!

Keith Chisarik
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