<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : DatePicker select several range of dates via code</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Calendar : DatePicker select several range of dates via code]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sat, 30 May 2026 09:39:19 +0000</pubDate>
  <lastBuildDate>Wed, 20 Jun 2007 15:41:49 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=7187</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[DatePicker select several range of dates via code : Now its working.  Thanks ]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=7187&amp;PID=23851&amp;title=datepicker-select-several-range-of-dates-via-code#23851</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3010">pjsde</a><br /><strong>Subject:</strong> 7187<br /><strong>Posted:</strong> 20 June 2007 at 3:41pm<br /><br /><P>Now its working.</P><DIV>&nbsp;</DIV><DIV>Thanks</DIV>]]>
   </description>
   <pubDate>Wed, 20 Jun 2007 15:41:49 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=7187&amp;PID=23851&amp;title=datepicker-select-several-range-of-dates-via-code#23851</guid>
  </item> 
  <item>
   <title><![CDATA[DatePicker select several range of dates via code : This is a really late reply, but...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=7187&amp;PID=23824&amp;title=datepicker-select-several-range-of-dates-via-code#23824</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1446">apuhjee</a><br /><strong>Subject:</strong> 7187<br /><strong>Posted:</strong> 19 June 2007 at 9:25pm<br /><br />This is a really late reply, but here it is anyways. <DIV>&nbsp;</DIV><DIV>It appears from the docs that DatePicker.Select() can be used to create multiple blocks, but DatePicker.SelectRange() will blow away what you already have selected!&nbsp; Seems a bit inconsistent.</DIV><DIV>&nbsp;</DIV><DIV>You can get around this with a few lines of code.</DIV><DIV>&nbsp;</DIV><DIV>Cheers ~ jp</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV><P style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: n&#111;ne" ="Ms&#111;normal"><SPAN style="FONT-SIZE: 10pt; COLOR: #2b91af; FONT-FAMILY: 'Courier New'">DateTime</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> min1 = <SPAN style="COLOR: #2b91af">DateTime</SPAN>.Now;<?:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><O:P></O:P></SPAN></P><P style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: n&#111;ne" ="Ms&#111;normal"><SPAN style="FONT-SIZE: 10pt; COLOR: #2b91af; FONT-FAMILY: 'Courier New'">DateTime</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> max1 = <SPAN style="COLOR: #2b91af">DateTime</SPAN>.Now.Add(<SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: #2b91af">TimeSpan</SPAN>(6, 0, 0, 0));<O:P></O:P></SPAN></P><P style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: n&#111;ne" ="Ms&#111;normal"><SPAN style="FONT-SIZE: 10pt; COLOR: #2b91af; FONT-FAMILY: 'Courier New'">DateTime</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> min2 = <SPAN style="COLOR: #2b91af">DateTime</SPAN>.Now.Add(<SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: #2b91af">TimeSpan</SPAN>(14, 0, 0, 0));<O:P></O:P></SPAN></P><P style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: n&#111;ne" ="Ms&#111;normal"><SPAN style="FONT-SIZE: 10pt; COLOR: #2b91af; FONT-FAMILY: 'Courier New'">DateTime</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> max2 = <SPAN style="COLOR: #2b91af">DateTime</SPAN>.Now.Add(<SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: #2b91af">TimeSpan</SPAN>(20, 0, 0, 0));<O:P></O:P></SPAN></P><P style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: n&#111;ne" ="Ms&#111;normal"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">&nbsp;<O:P></O:P></SPAN></P><P style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: n&#111;ne" ="Ms&#111;normal"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">selectRange(min1, max1);<O:P></O:P></SPAN></P><P style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: n&#111;ne" ="Ms&#111;normal"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">selectRange(min2, max2);<O:P></O:P></SPAN></P><P style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: n&#111;ne" ="Ms&#111;normal"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">&nbsp;<O:P></O:P></SPAN></P><P style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: n&#111;ne" ="Ms&#111;normal"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">&nbsp;<O:P></O:P></SPAN></P><P style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: n&#111;ne" ="Ms&#111;normal"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">private</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> <SPAN style="COLOR: blue">void</SPAN> selectRange(<SPAN style="COLOR: #2b91af">DateTime</SPAN> min, <SPAN style="COLOR: #2b91af">DateTime</SPAN> max)<O:P></O:P></SPAN></P><P style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: n&#111;ne" ="Ms&#111;normal"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">{<O:P></O:P></SPAN></P><P style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: n&#111;ne" ="Ms&#111;normal"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: green">//TODO: Assert min is less than max<O:P></O:P></SPAN></SPAN></P><P style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: n&#111;ne" ="Ms&#111;normal"><SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'">&nbsp;<O:P></O:P></SPAN></P><P style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: n&#111;ne" ="Ms&#111;normal"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: #2b91af">DateTime</SPAN> selDay = min;<O:P></O:P></SPAN></P><P style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: n&#111;ne" ="Ms&#111;normal"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-spacerun: yes"><SPAN style="COLOR: blue">&nbsp;&nbsp;&nbsp; while</SPAN> (selDay &lt;= max)</P><DIV><O:P></O:P></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>{<O:P></O:P></SPAN></DIV><P style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: n&#111;ne" ="Ms&#111;normal"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>datePicker.Select(selDay);<O:P></O:P></SPAN></P><P style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: n&#111;ne" ="Ms&#111;normal"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>selDay = selDay.Add(<SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: #2b91af">TimeSpan</SPAN>(1, 0, 0, 0));<O:P></O:P></SPAN></P><P style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: n&#111;ne" ="Ms&#111;normal"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>}<O:P></O:P></SPAN></P><P style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: n&#111;ne" ="Ms&#111;normal"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">}<O:P></O:P></SPAN></P><P style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: n&#111;ne" ="Ms&#111;normal"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">&nbsp;<O:P></O:P></SPAN></P><P style="MARGIN: 0in 0in 10pt" ="Ms&#111;normal"><FONT size=3><FONT face="Times New Roman">&nbsp;<O:P></O:P></FONT></FONT></P></DIV>]]>
   </description>
   <pubDate>Tue, 19 Jun 2007 21:25:07 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=7187&amp;PID=23824&amp;title=datepicker-select-several-range-of-dates-via-code#23824</guid>
  </item> 
  <item>
   <title><![CDATA[DatePicker select several range of dates via code : Hello,  I&amp;#039;m trying to select...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=7187&amp;PID=23087&amp;title=datepicker-select-several-range-of-dates-via-code#23087</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3010">pjsde</a><br /><strong>Subject:</strong> 7187<br /><strong>Posted:</strong> 20 May 2007 at 11:18am<br /><br /><P>Hello,</P><DIV>&nbsp;</DIV><DIV>I'm trying to select several range of dates in the DatePicker control via code, but it doesnt work. wend i use de selectrange( datemin, datemax) for all tha range of dates only the last block of date is selected. The AllowNoncontinuousSelection property is set to True.</DIV><DIV>&nbsp;</DIV><DIV>Please, how can i add mor than 1 block of dates via code in the DatePicker Control.</DIV><DIV>&nbsp;</DIV><DIV>Thanks</DIV>]]>
   </description>
   <pubDate>Sun, 20 May 2007 11:18:01 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=7187&amp;PID=23087&amp;title=datepicker-select-several-range-of-dates-via-code#23087</guid>
  </item> 
 </channel>
</rss>