﻿<?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?)  » DateTimePicker dirtying BO</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Sun, 14 Jun 2026 07:46:49 GMT</lastBuildDate><ttl>20</ttl><item><title>DateTimePicker dirtying BO</title><link>http://forum.strataframe.net/FindPost14307.aspx</link><description>I have a date field that allows NULLs in the db (the date can legitimately not be set).  I have the BO to return/set  1/1/1800 for NULL dates (I have Date.Parse("1800/1/1") as my replacement value).  I then have a SF DateTimePicker control bound to this.  When I navigate to a record with a NULL date, it makes the BO dirty.  I must be doing something wrong, but can't figure out what. Any ideas?</description><pubDate>Fri, 15 Feb 2008 15:10:47 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: DateTimePicker dirtying BO</title><link>http://forum.strataframe.net/FindPost14409.aspx</link><description>Totally understand. Let me me know! Thanks! :D</description><pubDate>Fri, 15 Feb 2008 15:10:47 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: DateTimePicker dirtying BO</title><link>http://forum.strataframe.net/FindPost14404.aspx</link><description>Greg,&lt;/P&gt;&lt;P&gt;I have this on my list to look at....I have some major time contraints on me this week...which is no different from any other week :) ...but I have not been able to look at this yet.&amp;nbsp; When I sit down to go through teh remaining items on the "to-do" list for 1.6.5 I was planning on looking at this then.&amp;nbsp; Sorry for the wait, but I have a ton on my plate this week (including my evenings) so I just haven't gotten around to it...but it is on my list.</description><pubDate>Fri, 15 Feb 2008 13:27:16 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: DateTimePicker dirtying BO</title><link>http://forum.strataframe.net/FindPost14398.aspx</link><description>Any progress on this? I need to make a decision quickly about whether to just bail with using the DateTimePicker.  As it stands now, it won't work (well) with any field that is using NULLs.</description><pubDate>Fri, 15 Feb 2008 10:46:20 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: DateTimePicker dirtying BO</title><link>http://forum.strataframe.net/FindPost14381.aspx</link><description>Bump... :D</description><pubDate>Wed, 13 Feb 2008 19:53:16 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: DateTimePicker dirtying BO</title><link>http://forum.strataframe.net/FindPost14329.aspx</link><description>Trent,&lt;br&gt;
&lt;br&gt;
Here is a sample. You will need to add a column to the Orders table so there is a NULL date column. There is a sql script in the project directory you can run.  &lt;br&gt;
&lt;br&gt;
Tests:&lt;br&gt;
- The first time you open it, all the rows will have null for the new date column and all will work fine.&lt;br&gt;
- Move the first row, hit edit and enter a date for the received date, save.&lt;br&gt;
- Now move to the next row. You will notice two things: the record is now dirty and you can't navigate any longer (no idea why).&lt;br&gt;
- If you unbind the received date datetimepicker, it works again. &lt;br&gt;
&lt;br&gt;</description><pubDate>Tue, 12 Feb 2008 13:14:28 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: DateTimePicker dirtying BO</title><link>http://forum.strataframe.net/FindPost14315.aspx</link><description>Greg,&lt;/P&gt;&lt;P&gt;I believe you, but there is some else in the formula that is causing this to manifest itself, which is probably the NULL settings.&amp;nbsp; Send me a sample with a BO set just like the one that is causing the issue so I can debug what is going on.&amp;nbsp; I am having a harder time on this side reproducing the exact same scenario. :ermm:</description><pubDate>Tue, 12 Feb 2008 08:01:41 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: DateTimePicker dirtying BO</title><link>http://forum.strataframe.net/FindPost14314.aspx</link><description>It is definitely something related to the DateTimePicker and the field in the BO using an alternate value for NULLs. If I unbind the datetimepicker, all is well. I have another date field on the form that can't be NULL and all is well there. If I switch between two rows that are NULL for this field (ResolutionDate), no problems. If I switch between two fields that have dates, then no problems.&lt;br&gt;
&lt;br&gt;
I have the BO set to return an alternate value if the DB field is NULL/ set NULL if the BO field is the alternate value. The alternate value I'm using is 1/1/1800. I set this alternate value as Date.Parse("1800/1/1") and also tried #1/1/1800# in BO mapper. There appeared to be no difference between the two.  The DateTimePicker is set to use 1/1/1800 as its NULL value and it is set to strip time from the date.  I must be missing something....:crazy:</description><pubDate>Mon, 11 Feb 2008 20:56:24 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: DateTimePicker dirtying BO</title><link>http://forum.strataframe.net/FindPost14313.aspx</link><description>Well, I did that and it appears that the datetimepicker is causing the problem. Here is the complete call stack from the Set method:&lt;br&gt;
[quote][b]BusinessObjects.dll!FOXSystems.RAMS.BusinessObjects.Project.ProjectActionItemsBO.set_ResolutionDate(Date value = #1/1/1800#) Line 415Basic&lt;br&gt;
 BusinessObjects.dll!FOXSystems.RAMS.BusinessObjects.Project.ProjectActionItemsBO.Field_ResolutionDate_Descriptor.SetValue(Object component = {FOXSystems.RAMS.BusinessObjects.Project.ProjectActionItemsBO}, Object Value = #1/1/1800#) Line 869 + 0x45 bytesBasic[/b]&lt;br&gt;
System.Windows.Forms.dll!System.Windows.Forms.BindToObject.SetValue(object value) + 0x58 bytes&lt;br&gt;
 System.Windows.Forms.dll!System.Windows.Forms.Binding.PullData(bool reformat, bool force) + 0x14f bytes&lt;br&gt;
 System.Windows.Forms.dll!System.Windows.Forms.Binding.Target_PropertyChanged(object sender, System.EventArgs e) + 0x28 bytes&lt;br&gt;
 MicroFour StrataFrame UI.dll!MicroFour.StrataFrame.UI.Windows.Forms.DateTimePicker.OnBindableValueChanged() + 0x1a bytes&lt;br&gt;
 MicroFour StrataFrame UI.dll!MicroFour.StrataFrame.UI.Windows.Forms.DateTimePicker.BindableValue.set(System.DateTime value) + 0x2c5 bytes&lt;br&gt;
 [Native to Managed Transition]&lt;br&gt;
 [Managed to Native Transition]&lt;br&gt;
&lt;br&gt;
 [b][i]--&gt; I'm guessing that the the two different values here are the old value (2/8/2008) and the new value (1/1/1800...NULL).[/i][/b]  &lt;br&gt;
 System.dll!System.ComponentModel.ReflectPropertyDescriptor.SetValue(object component = {MicroFour.StrataFrame.UI.Windows.Forms.DateTimePicker, Value: 2/8/2008 12:00:00 AM}, object value = {1/1/1800 12:00:00 AM}) + 0xe3 bytes&lt;br&gt;
&lt;br&gt;
 System.Windows.Forms.dll!System.Windows.Forms.Binding.SetPropValue(object value) + 0xc9 bytes&lt;br&gt;
 System.Windows.Forms.dll!System.Windows.Forms.Binding.PushData(bool force) + 0x71 bytes&lt;br&gt;
 System.Windows.Forms.dll!System.Windows.Forms.Binding.ReadValue() + 0xa bytes&lt;br&gt;
 MicroFour StrataFrame Business.dll!MicroFour.StrataFrame.Business.BusinessLayer.RefreshValue(System.Windows.Forms.Control ControlToRefresh = {MicroFour.StrataFrame.UI.Windows.Forms.DateTimePicker, Value: 2/8/2008 12:00:00 AM}, string PropertyName = "BindableValue") + 0x3b bytes&lt;br&gt;
 MicroFour StrataFrame Business.dll!MicroFour.StrataFrame.Business.BusinessLayer.RefreshControl(MicroFour.StrataFrame.UI.Windows.Forms.IBusinessBindable ControlToRefresh = {MicroFour.StrataFrame.UI.Windows.Forms.DateTimePicker, Value: 2/8/2008 12:00:00 AM}, bool DataPresent) + 0x269 bytes&lt;br&gt;
 MicroFour StrataFrame Business.dll!MicroFour.StrataFrame.Business.BusinessLayer.RefreshBoundControls() + 0x89 bytes&lt;br&gt;
 MicroFour StrataFrame Business.dll!MicroFour.StrataFrame.Business.BusinessLayer.raise_Navigated(MicroFour.StrataFrame.Business.NavigatedEventArgs e = {MicroFour.StrataFrame.Business.NavigatedEventArgs}) + 0xbb bytes&lt;br&gt;
 MicroFour StrataFrame Business.dll!MicroFour.StrataFrame.Business.BusinessLayer.OnNavigated(MicroFour.StrataFrame.Business.NavigatedEventArgs e) + 0x8 bytes&lt;br&gt;
 MicroFour StrataFrame Business.dll!MicroFour.StrataFrame.Business.BusinessLayer.Navigate(MicroFour.StrataFrame.Business.BusinessNavigationDirection Direction, int AbsoluteIndex, object[] PrimaryKeyValues, bool AttemptToCheckRules, bool IsRefill) + 0x3c8 bytes&lt;br&gt;
 MicroFour StrataFrame Business.dll!MicroFour.StrataFrame.Business.BusinessLayer.NavigateToPrimaryKey(object[] PrimaryKeyValues) + 0x13 bytes&lt;br&gt;
 [b]RamsUI.dll!FOXSystems.RAMS.UI.Forms.Controls.SynchListView.SetBOValue(Integer id = 2) Line 108 + 0x4d bytesBasic&lt;br&gt;
 RamsUI.dll!FOXSystems.RAMS.UI.Forms.Controls.SynchListView.NavByList() Line 131 + 0x18 bytesBasic&lt;br&gt;
 RamsUI.dll!FOXSystems.RAMS.UI.Forms.Controls.SynchListView.SynchListView_SelectedIndexChanged(Object sender = {FOXSystems.RAMS.UI.Forms.Controls.SynchListView}, System.EventArgs e = {System.EventArgs}) Line 199 + 0x9 bytesBasic[/b]&lt;br&gt;
&lt;br&gt;
[b][i]---&gt; User action (selecting an item in a listview) causes the SelectedIndexChangedEvent above[/i][/b]&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
 System.Windows.Forms.dll!System.Windows.Forms.ListView.OnSelectedIndexChanged(System.EventArgs e) + 0x6a bytes&lt;br&gt;
 System.Windows.Forms.dll!System.Windows.Forms.ListView.WmReflectNotify(ref System.Windows.Forms.Message m) + 0x80e bytes&lt;br&gt;
 System.Windows.Forms.dll!System.Windows.Forms.ListView.WndProc(ref System.Windows.Forms.Message m) + 0x9d bytes&lt;br&gt;
 System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNative&amp;#119;indow.OnMessage(ref System.Windows.Forms.Message m) + 0xd bytes&lt;br&gt;
 System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNative&amp;#119;indow.WndProc(ref System.Windows.Forms.Message m) + 0x36 bytes&lt;br&gt;
 System.Windows.Forms.dll!System.Windows.Forms.Native&amp;#119;indow.DebuggableCallback(System.IntPtr hWnd, int msg = 8270, System.IntPtr wparam, System.IntPtr lparam) + 0x57 bytes&lt;br&gt;
 [Native to Managed Transition]&lt;br&gt;
 [Managed to Native Transition]&lt;br&gt;
 System.Windows.Forms.dll!System.Windows.Forms.Control.SendMessage(int msg, System.IntPtr wparam, System.IntPtr lparam) + 0x42 bytes&lt;br&gt;
 System.Windows.Forms.dll!System.Windows.Forms.Control.ReflectMessageInternal(System.IntPtr hWnd, ref System.Windows.Forms.Message m = {msg=0x4e (WM_NOTIFY) hwnd=0x1009b6 wparam=0xf0a14 lparam=0x4e5e1c8 result=0x0}) + 0x3e bytes&lt;br&gt;
 System.Windows.Forms.dll!System.Windows.Forms.Control.WmNotify(ref System.Windows.Forms.Message m = {msg=0x4e (WM_NOTIFY) hwnd=0x1009b6 wparam=0xf0a14 lparam=0x4e5e1c8 result=0x0}) + 0x2f bytes&lt;br&gt;
 System.Windows.Forms.dll!System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m) + 0x688 bytes&lt;br&gt;
 System.Windows.Forms.dll!System.Windows.Forms.ScrollableControl.WndProc(ref System.Windows.Forms.Message m) + 0x45 bytes&lt;br&gt;
 System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNative&amp;#119;indow.OnMessage(ref System.Windows.Forms.Message m) + 0xd bytes&lt;br&gt;
 System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNative&amp;#119;indow.WndProc(ref System.Windows.Forms.Message m) + 0x36 bytes&lt;br&gt;
 System.Windows.Forms.dll!System.Windows.Forms.Native&amp;#119;indow.DebuggableCallback(System.IntPtr hWnd, int msg = 78, System.IntPtr wparam, System.IntPtr lparam) + 0x57 bytes&lt;br&gt;
 [Native to Managed Transition]&lt;br&gt;
 System.Windows.Forms.dll!System.Windows.Forms.Native&amp;#119;indow.DefWndProc(ref System.Windows.Forms.Message m = {msg=0x201 (WM_LBUTTONDOWN) hwnd=0xf0a14 wparam=0x1 lparam=0x2c009d result=0x0}) + 0x94 bytes&lt;br&gt;
 System.Windows.Forms.dll!System.Windows.Forms.Control.DefWndProc(ref System.Windows.Forms.Message m) + 0xc bytes&lt;br&gt;
 System.Windows.Forms.dll!System.Windows.Forms.ListView.WmMouseDown(ref System.Windows.Forms.Message m, System.Windows.Forms.MouseButtons button, int clicks) + 0xf3 bytes&lt;br&gt;
 System.Windows.Forms.dll!System.Windows.Forms.ListView.WndProc(ref System.Windows.Forms.Message m) + 0xef bytes&lt;br&gt;
 System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNative&amp;#119;indow.OnMessage(ref System.Windows.Forms.Message m) + 0xd bytes&lt;br&gt;
 System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNative&amp;#119;indow.WndProc(ref System.Windows.Forms.Message m) + 0x36 bytes&lt;br&gt;
 System.Windows.Forms.dll!System.Windows.Forms.Native&amp;#119;indow.DebuggableCallback(System.IntPtr hWnd, int msg = 513, System.IntPtr wparam, System.IntPtr lparam) + 0x57 bytes&lt;br&gt;
 [Native to Managed Transition]&lt;br&gt;
 [Managed to Native Transition]&lt;br&gt;
 System.Windows.Forms.dll!System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(int dwComponentID, int reason = -1, int pvLoopData = 0) + 0x2f1 bytes&lt;br&gt;
 System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(int reason = -1, System.Windows.Forms.ApplicationContext context = {System.Windows.Forms.ApplicationContext}) + 0x17d bytes&lt;br&gt;
 System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoop(int reason, System.Windows.Forms.ApplicationContext context) + 0x53 bytes&lt;br&gt;
 System.Windows.Forms.dll!System.Windows.Forms.Application.Run(System.Windows.Forms.Form mainForm) + 0x2e bytes&lt;br&gt;
 MicroFour StrataFrame UI.dll!MicroFour.StrataFrame.Application.StrataFrameApplication.RunApplication() + 0x296 bytes&lt;br&gt;
 RAMS.NET.exe!FOXSystems.RAMS.AppMain.Main() Line 35 + 0x6 bytesBasic&lt;br&gt;
 [Native to Managed Transition]&lt;br&gt;
 [Managed to Native Transition]&lt;br&gt;
 mscorlib.dll!System.AppDomain.nExecuteAssembly(System.Reflection.Assembly assembly, string[] args) + 0x17 bytes&lt;br&gt;
 mscorlib.dll!System.Runtime.Hosting.ManifestRunner.Run(bool checkAptModel) + 0xd2 bytes&lt;br&gt;
 mscorlib.dll!System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly() + 0x81 bytes&lt;br&gt;
 mscorlib.dll!System.Runtime.Hosting.ApplicationActivator.CreateInstance(System.ActivationContext activationContext, string[] activationCustomData) + 0x64 bytes&lt;br&gt;
 mscorlib.dll!System.Runtime.Hosting.ApplicationActivator.CreateInstance(System.ActivationContext activationContext) + 0x7 bytes&lt;br&gt;
 Microsoft.VisualStudio.HostingProcess.Utilities.dll!Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone() + 0x55 bytes&lt;br&gt;
 mscorlib.dll!System.Threading.ThreadHelper.ThreadStart_Context(object state) + 0x3b bytes&lt;br&gt;
 mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x81 bytes&lt;br&gt;
 mscorlib.dll!System.Threading.ThreadHelper.ThreadStart() + 0x40 bytes[/quote]&lt;br&gt;
&lt;br&gt;
I'll also include the SetBOValue (perhaps not the best name :ermm: ), which simply navigates to the PK of the record selected in the list:&lt;br&gt;
[codesnippet]     Public Sub SetBOValue(ByVal id As Integer)&lt;br&gt;
      '-- Only do anything if the provided ID isn't already&lt;br&gt;
      '   the current value.&lt;br&gt;
      If id &gt; 0 AndAlso (Me.DataBO.CurrentRowIndex &lt; 0 OrElse CInt(Me.DataBO.Item(Me.DataBO.PrimaryKeyField)) &lt;&gt; id) Then&lt;br&gt;
        Me.DataBO.NavigateToPrimaryKey(id)&lt;br&gt;
      End If&lt;br&gt;
    End Sub[/codesnippet]&lt;br&gt;
&lt;br&gt;
I'm not seeing anything in my code that is causing this. I'm wondering if I have the DateTimePicker setup correctly.</description><pubDate>Mon, 11 Feb 2008 20:40:46 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: DateTimePicker dirtying BO</title><link>http://forum.strataframe.net/FindPost14310.aspx</link><description>Hmmm....by default this shouldn't be happening since the Get is where the logic will reside for the NULL value.&amp;nbsp; So something is forcing the Set to be called.&amp;nbsp; You might put a breakpoint in the Set of the property and then look at the call stack to see where the Set is coming from.&amp;nbsp; It might at least get you going in the right direction.</description><pubDate>Mon, 11 Feb 2008 17:42:26 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>