﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » WinForms (How do I?)  » Custom Holiday DateTime picker</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Mon, 08 Jun 2026 23:45:59 GMT</lastBuildDate><ttl>20</ttl><item><title>Custom Holiday DateTime picker</title><link>http://forum.strataframe.net/FindPost32420.aspx</link><description>I needed a control that allowed the user to select a valid date (while specifying whether or not they wanted to Skip Holidays and/or Skip Weekends), and to also optionally, select a SQL Server validated Start and Ending Date/Time).&amp;nbsp; The control had to be driven by a table of customer generated Holidays ... IOW ... birthdays, Jewish Holidays, special company events, etc.&amp;nbsp; based upon the content of a Holiday table).&lt;br/&gt;&lt;br/&gt;It also had to take the form of a user control so it could be used throughout the project just by dropping it on the form.&lt;br/&gt;&lt;br/&gt;It took a while of trial and error (I not gonna tell you how much trial and error as I don't want to embarrass myself) before I reached a code base that was remotely professional.&lt;br/&gt;&lt;br/&gt;The project contains custom controls (I never knew how to create these before now ... I wanted to learn).&lt;br/&gt;&lt;br/&gt;It also contains a text file named HolidayDefinitionScript.txt which, when run, creates the required SQL Server Holiday table.&lt;br/&gt;&lt;br/&gt;Hope this helps someone.&lt;br/&gt;&lt;br/&gt;CT&lt;br/&gt;&lt;br/&gt;&lt;a href="https://www.dropbox.com/s/tb8af1gvhzcfiqc/NovantCustomControls.zip"&gt;&lt;a href="https://www.dropbox.com/s/tb8af1gvhzcfiqc/NovantCustomControls.zip"&gt;https://www.dropbox.com/s/tb8af1gvhzcfiqc/NovantCustomControls.zip&lt;/a&gt;&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;Here is how to implement it after you drop it on one of your forms:&lt;br/&gt;&lt;br/&gt;&lt;pre style="background: white; color: black; font-family: Courier New; font-size: 14px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&amp;nbsp;TestForm()&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;InitializeComponent();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: rgb(43, 145, 175);"&gt;DataTable&lt;/span&gt;&amp;nbsp;dtHolidays&amp;nbsp;=&amp;nbsp;HolidaysBO.getAllFutureHolidays();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;adpAppointmentPicker.addHolidays(dtHolidays); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/pre&gt;All I did was to create a public method in my HolidaysBO business object that returns&amp;nbsp;all future Holidays and then pass the resulting DataTable to the control's .AddHolidays() method.&lt;br/&gt;&lt;br/&gt;Maybe ... just maybe ... someone will figure how to bind the properties ( _startDateTime, _endDateTime and _appointmentDate) to three corresponding properties of a BO ... hint, hint.&lt;br/&gt;&lt;br/&gt;C.T.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;</description><pubDate>Sat, 08 Feb 2014 17:33:06 GMT</pubDate><dc:creator>Charles Thomas Blankenship</dc:creator></item><item><title>RE: Custom Holiday DateTime picker</title><link>http://forum.strataframe.net/FindPost32421.aspx</link><description>&lt;span id="ctl00_ctlContentPlaceHolder_ctl00_ctlTopic_ctlPanelBar_ctlTopicsRepeater_ctl01_lblFullMessage"&gt;Sorry about the formatting ... this should help:&lt;br/&gt;&lt;br/&gt;I&amp;nbsp;needed a control that allowed the user to select a valid date (while specifying whether or not they wanted to Skip Holidays and/or Skip Weekends), and to also optionally, select a SQL Server validated Start and Ending Date/Time).&amp;nbsp; The control had to be driven by a table of customer generated Holidays ... IOW ... birthdays, Jewish Holidays, special company events, etc.&amp;nbsp; based upon the content of a Holiday table).&lt;br/&gt;&lt;br/&gt;It also had to take the form of a user control so it could be used throughout the project just by dropping it on the form.&lt;br/&gt;&lt;br/&gt;It took a while of trial and error (I not gonna tell you how much trial and error as I don't want to embarrass myself) before I reached a code base that was remotely professional.&lt;br/&gt;&lt;br/&gt;The project contains custom controls (I never knew how to create these before now ... I wanted to learn).&lt;br/&gt;&lt;br/&gt;It also contains a text file named HolidayDefinitionScript.txt which, when run, creates the required SQL Server Holiday table.&lt;br/&gt;&lt;br/&gt;Hope this helps someone.&lt;br/&gt;&lt;br/&gt;CT&lt;br/&gt;&lt;br/&gt;&lt;a href="https://www.dropbox.com/s/tb8af1gvhzcfiqc/NovantCustomControls.zip"&gt;&lt;a href="https://www.dropbox.com/s/tb8af1gvhzcfiqc/NovantCustomControls.zip"&gt;&lt;font color="#1f5080"&gt;&lt;a href="https://www.dropbox.com/s/tb8af1gvhzcfiqc/NovantCustomControls.zip"&gt;https://www.dropbox.com/s/tb8af1gvhzcfiqc/NovantCustomControls.zip&lt;/a&gt;&lt;/font&gt;&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;Here is how to implement it after you drop it on one of your forms:&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;pre style="background: white; color: black; font-family: Courier New; font-size: 14px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&amp;nbsp;TestForm()&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/pre&gt;&lt;pre style="background: white; color: black; font-family: Courier New; font-size: 14px;"&gt;        {InitializeComponent();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/pre&gt;&lt;pre style="background: white; color: black; font-family: Courier New; font-size: 14px;"&gt;         &lt;span style="color: rgb(43, 145, 175);"&gt;DataTable&lt;/span&gt;&amp;nbsp;dtHolidays&amp;nbsp;=&amp;nbsp;HolidaysBO.getAllFutureHolidays();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/pre&gt;&lt;pre style="background: white; color: black; font-family: Courier New; font-size: 14px;"&gt;         adpAppointmentPicker.addHolidays(dtHolidays);}&lt;/pre&gt;All I did was to create a public method in my HolidaysBO business object that returns&amp;nbsp;all future Holidays and then pass the resulting DataTable to the control's .AddHolidays() method.&lt;br/&gt;&lt;br/&gt;Maybe ... just maybe ... someone will figure how to bind the properties ( _startDateTime, _endDateTime and _appointmentDate) to three corresponding properties of a BO ... hint, hint.&lt;br/&gt;&lt;br/&gt;&lt;/span&gt;&lt;br/&gt;</description><pubDate>Sat, 08 Feb 2014 17:33:06 GMT</pubDate><dc:creator>Charles Thomas Blankenship</dc:creator></item></channel></rss>