StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



1/1/1800 default valueExpand / Collapse
Author
Message
Posted 03/16/2007 10:13:00 AM


Advanced StrataFrame User

Advanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame User

Group: StrataFrame Users
Last Login: Today @ 7:29:23 AM
Posts: 658, Visits: 27,036
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

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



  Post Attachments 
dates.jpg (88 views, 24.27 KB)
Post #7548
Posted 03/16/2007 10:34:13 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 4:50:35 PM
Posts: 4,796, Visits: 4,766
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.

Post #7550
Posted 03/19/2007 10:53:12 AM


Advanced StrataFrame User

Advanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame User

Group: StrataFrame Users
Last Login: Today @ 7:29:23 AM
Posts: 658, Visits: 27,036
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.



  Post Attachments 
listview.jpg (67 views, 27.46 KB)
Post #7579
Posted 03/19/2007 11:00:14 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Yesterday @ 4:50:35 PM
Posts: 4,796, Visits: 4,766
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.

Post #7581
Posted 03/19/2007 11:03:13 AM


Advanced StrataFrame User

Advanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame User

Group: StrataFrame Users
Last Login: Today @ 7:29:23 AM
Posts: 658, Visits: 27,036
awesome thanks!
Post #7583
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 7:32am

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.125. 11 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.