<?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 : DateTimePicker in RC Item</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Report Control : DateTimePicker in RC Item]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Thu, 14 May 2026 12:28:41 +0000</pubDate>
  <lastBuildDate>Tue, 06 Nov 2012 05:20:17 +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=20153</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[DateTimePicker in RC Item :                ...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=20153&amp;PID=69177&amp;title=datetimepicker-in-rc-item#69177</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2960">Xander75</a><br /><strong>Subject:</strong> 20153<br /><strong>Posted:</strong> 06 November 2012 at 5:20am<br /><br />Hi,<br><br>The following code example shows how to add the DateTimePicker control, but can be used for any control. The original version of this code is found at: <a href="http://forum.codejock.com/forum_posts.asp?TID=18679&amp;KW=DateTimePicker&amp;title=adding-c&#111;ntrol-please-help" target="_blank">http://forum.codejock.com/forum_posts.asp?TID=18679&amp;KW=DateTimePicker&amp;title=adding-control-please-help</a><br><br>However I have changed the code to use the BeginEdit event as this works better than FocusChanging. I also tweaked the code to set the position relative to the ReportControls position, as this is not always set as Left = 0 and Top = 0 on the screen.<br><br>The code for showing/hiding the DateTimePicker has been added to a module so this can be reusable for any ReportControl.<br><br><font color="#FF0000"><b>Note:</b></font> I prefer to use the MSComCtl2.DTPicker instead of Codejocks XtremeSuiteControls.DateTimePicker as it allows me to change the colours. I find the XtremeSuiteControls.DateTimePicker Day names to be unreadable when used in conjunction with the SkinFramework control. Plus if you use the XtremeSuiteControls.DateTimePicker you will find the navigation on press of the Tab key doesn't quite work correctly as when the DateTimePicker has focus it then moves out of the ReportControl into other controls even with TabStop set as false! Using the MSComCtl2.DTPicker resolves this when setting TabStop to False allowing the Tab key navigation to flow correctly within the ReportControl even when the DTPicker has focus.<br><br>Form Code<br><table width="99%"><tr><td><pre class="BBcode">' Some test data for this example<br>Private Sub Form_Load()<br>&nbsp;&nbsp;&nbsp; With ReportControl<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .AllowEdit = True<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .AutoColumnSizing = True<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .EditOnClick = True<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .FocusSubItems = True<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim Column As ReportColumn<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set Column = .Columns.Add(0, "Column 1", 150, False)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set Column = .Columns.Add(1, "Date 1", 90, False)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set Column = .Columns.Add(2, "Date 2", 90, False)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Populate<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim Record As ReportRecord<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; For i = 0 To 100<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set Record = .Records.Add<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; With Record<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .AddItem "Row: " &amp; i<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .AddItem Date<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .AddItem Date<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End With<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Next<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Populate<br>&nbsp;&nbsp;&nbsp; End With<br>End Sub<br><br>' Below is the code events required for the DateTimePicker &amp; ReportControl<br>Private Sub DateTimePicker_Change()<br>&nbsp;&nbsp;&nbsp; ReportControl.FocusedRow.Record(ReportControl.FocusedColumn.Index).Value = DateTimePicker.Value<br>&nbsp;&nbsp;&nbsp; ReportControl.Populate<br>End Sub<br><br>Private Sub ReportControl_BeginEdit(ByVal Row As XtremeReportControl.IReportRow, ByVal Column As XtremeReportControl.IReportColumn, ByVal Item As XtremeReportControl.IReportRecordItem)<br>&nbsp;&nbsp;&nbsp; DateTimePicker.Visible = False<br>&nbsp;&nbsp;&nbsp; Select Case Column.Index<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Case 1, 2<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Call ShowDatePicker(ReportControl, DateTimePicker, Row, Column, Item)<br>&nbsp;&nbsp;&nbsp; End Select<br>End Sub<br><br>Private Sub ReportControl_FocusChanging(ByVal NewRow As XtremeReportControl.IReportRow, ByVal NewColumn As XtremeReportControl.IReportColumn, ByVal NewItem As XtremeReportControl.IReportRecordItem, Cancel As Boolean)<br>&nbsp;&nbsp;&nbsp; Call HideDatePicker(DateTimePicker)<br>End Sub<br><br>Private Sub ReportControl_VScroll(ByVal Section As Long, ByVal Position As Long)<br>&nbsp;&nbsp;&nbsp; Call HideDatePicker(DateTimePicker)<br>End Sub<br></pre></td></tr></table><br>Module Code<br><table width="99%"><tr><td><pre class="BBcode">Public Sub HideDatePicker(ByVal DTPicker As XtremeSuiteControls.DateTimePicker)<br>&nbsp;&nbsp;&nbsp; With DTPicker<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Move -10000, -10000, DTPicker.Width, DTPicker.Height<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .ZOrder 1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Visible = False<br>&nbsp;&nbsp;&nbsp; End With<br>End Sub<br><br>Public Sub ShowDatePicker(ByVal rc As XtremeReportControl.ReportControl, ByVal DTPicker As XtremeSuiteControls.DateTimePicker, ByVal Row As XtremeReportControl.IReportRow, ByVal Column As XtremeReportControl.IReportColumn, ByVal Item As XtremeReportControl.IReportRecordItem)<br>&nbsp;&nbsp;&nbsp; Dim l As Long, t As Long, r As Long, b As Long, x As Long, y As Long<br>&nbsp;&nbsp;&nbsp; x = Screen.TwipsPerPixelX<br>&nbsp;&nbsp;&nbsp; y = Screen.TwipsPerPixelY<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; rc.Rows(Row.Index).GetItemRect Item, l, t, r, b<br>&nbsp;&nbsp;&nbsp; l = l * x<br>&nbsp;&nbsp;&nbsp; t = t * y<br>&nbsp;&nbsp;&nbsp; r = r * x<br>&nbsp;&nbsp;&nbsp; b = b * y<br><br>&nbsp;&nbsp;&nbsp; With DTPicker<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Move (rc.Left + x) + l, (rc.Top + y) + t, (r - l) + x, (b - t) + y<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .ZOrder 0<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Visible = True<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Value = Item.Value<br>&nbsp;&nbsp;&nbsp; End With<br>End Sub<br></pre></td></tr></table><br>]]>
   </description>
   <pubDate>Tue, 06 Nov 2012 05:20:17 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=20153&amp;PID=69177&amp;title=datetimepicker-in-rc-item#69177</guid>
  </item> 
  <item>
   <title><![CDATA[DateTimePicker in RC Item :    How to add custom control...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=20153&amp;PID=68950&amp;title=datetimepicker-in-rc-item#68950</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=7396">kerog</a><br /><strong>Subject:</strong> 20153<br /><strong>Posted:</strong> 24 September 2012 at 5:24am<br /><br /><p>How to add custom control to ReportRecordItem? I'd like to add to Item DateTimePicker.</p><p>Can you give an example ho to do it?</p><p>Regards</p>]]>
   </description>
   <pubDate>Mon, 24 Sep 2012 05:24:43 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=20153&amp;PID=68950&amp;title=datetimepicker-in-rc-item#68950</guid>
  </item> 
 </channel>
</rss>