<?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="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : Updating Custom Properties</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce Classic : Updating Custom Properties</description>
  <pubDate>Fri, 12 Jun 2026 10:01:00 -700</pubDate>
  <lastBuildDate>Mon, 18 Jun 2007 14:48:18 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=88</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>Updating Custom Properties : The TechTip on &amp;#034;Refreshing...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=88&amp;PID=181#181</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=23" rel="nofollow">davidklitzke</a><br /><strong>Subject:</strong> 88<br /><strong>Posted:</strong> 18-Jun-2007 at 2:48pm<br /><br />The TechTip on "Refreshing Dependent Parents" is excellent, but I thought I would try my hand&nbsp;on one of the tutorials.&nbsp; I started with the Fundamental tutorial on "Populating a Winform".&nbsp; First, I created a custom property for TotalCost:<DIV>&nbsp;</DIV><DIV><FONT color=#0000ff size=2><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: n&#111;ne"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">public</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><FONT color=#000000> </FONT><SPAN style="COLOR: blue">decimal</SPAN><FONT color=#000000> TotalCost {<?:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></FONT></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: n&#111;ne"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes"><FONT color=#000000>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT></SPAN><SPAN style="COLOR: blue">get</SPAN><FONT color=#000000> {<o:p></o:p></FONT></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: n&#111;ne"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes"><FONT color=#000000>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT></SPAN><SPAN style="COLOR: blue">decimal</SPAN><FONT color=#000000> total = 0;<o:p></o:p></FONT></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: n&#111;ne"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes"><FONT color=#000000>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT></SPAN><SPAN style="COLOR: blue">foreach</SPAN><FONT color=#000000> (</FONT><SPAN style="COLOR: #2b91af">OrderDetail</SPAN><FONT color=#000000> detail </FONT><SPAN style="COLOR: blue">in</SPAN><FONT color=#000000> </FONT><SPAN style="COLOR: blue">this</SPAN><FONT color=#000000>.OrderDetails) {<o:p></o:p></FONT></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: n&#111;ne"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><FONT color=#000000><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>total += detail.UnitPrice * detail.Quantity;<o:p></o:p></FONT></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: n&#111;ne"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><FONT color=#000000><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></FONT></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: n&#111;ne"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes"><FONT color=#000000>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT></SPAN><SPAN style="COLOR: blue">return</SPAN><FONT color=#000000> total;<o:p></o:p></FONT></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: n&#111;ne"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><FONT color=#000000><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></FONT></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: n&#111;ne"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><FONT color=#000000><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></FONT></SPAN></P><P>Then, I added an OnColumnChanging Event Handler for OrderDetail:</P><DIV><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN style="mso-no-proof: yes"><FONT size=3><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes"><FONT color=#000000>&nbsp;&nbsp;&nbsp; </FONT></SPAN><SPAN style="COLOR: blue">protected</SPAN><FONT color=#000000> </FONT><SPAN style="COLOR: blue">override</SPAN><FONT color=#000000> </FONT><SPAN style="COLOR: blue">void</SPAN><FONT color=#000000> OnColumnChanged(</FONT><SPAN style="COLOR: #2b91af">DataColumnChangeEventArgs</SPAN><FONT color=#000000> pArgs) {<o:p></o:p></FONT></FONT></FONT></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN style="mso-no-proof: yes"><FONT size=3><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes"><FONT color=#000000>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT></SPAN><SPAN style="COLOR: blue">base</SPAN><FONT color=#000000>.OnColumnChanged(pArgs);<o:p></o:p></FONT></FONT></FONT></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN style="mso-no-proof: yes"><FONT size=3><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes"><FONT color=#000000>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT></SPAN><SPAN style="COLOR: blue">this</SPAN><FONT color=#000000>.Order.ForcePropertyChanged(</FONT><SPAN style="COLOR: blue">null</SPAN><FONT color=#000000>);<o:p></o:p></FONT></FONT></FONT></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN style="mso-no-proof: yes"><FONT size=3><FONT color=#000000><FONT face="Times New Roman"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>}</P><DIV>&nbsp;</DIV><DIV>I thought that this would be all I needed, but I didn't see an immediate change in TotalCost.&nbsp; As&nbsp;a last resort, I tried adding a ForcePropertyChanged for the Employee as well:</DIV><DIV>&nbsp;</DIV><DIV><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN style="COLOR: blue; mso-no-proof: yes">protected</SPAN><SPAN style="mso-no-proof: yes"> <SPAN style="COLOR: blue">override</SPAN> <SPAN style="COLOR: blue">void</SPAN> OnColumnChanged(<SPAN style="COLOR: #2b91af">DataColumnChangeEventArgs</SPAN> pArgs) {<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN style="mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">base</SPAN>.OnColumnChanged(pArgs);<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN style="mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">this</SPAN>.Order.ForcePropertyChanged(<SPAN style="COLOR: blue">null</SPAN>);<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN style="mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: #2b91af">PrimaryKey</SPAN> pKey = <SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: #2b91af">PrimaryKey</SPAN>(<SPAN style="COLOR: blue">typeof</SPAN>(<SPAN style="COLOR: #2b91af">Employee</SPAN>), <SPAN style="COLOR: blue">this</SPAN>.Order.EmployeeId);<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN style="mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: #2b91af">Employee</SPAN> aEmployee = (<SPAN style="COLOR: #2b91af">Employee</SPAN>)<SPAN style="COLOR: blue">this</SPAN>.PersistenceManager.GetEntity(pKey);<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN style="mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>aEmployee.ForcePropertyChanged(<SPAN style="COLOR: blue">null</SPAN>);<o:p></o:p></SPAN></P><SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN-US; mso-fareast-: EN-US; mso-bidi-: AR-SA"><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>}</SPAN></DIV><DIV>&nbsp;</DIV><DIV></DIV><DIV></DIV><DIV></DIV><DIV></DIV><DIV></DIV><DIV>I am not sure why the ForcePropertChanged on Employee is necessary, but I suspect it is because this tutorial uses chained bindings.</DIV><DIV></FONT></FONT></FONT></SPAN>&nbsp;</DIV></DIV></FONT></DIV>]]>
   </description>
   <pubDate>Mon, 18 Jun 2007 14:48:18 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=88&amp;PID=181#181</guid>
  </item> 
  <item>
   <title>Updating Custom Properties : Jeff,  Perfect! I added a few...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=88&amp;PID=180#180</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=24" rel="nofollow">Linguinut</a><br /><strong>Subject:</strong> 88<br /><strong>Posted:</strong> 18-Jun-2007 at 2:41pm<br /><br />Jeff,<DIV>&nbsp;</DIV><DIV>Perfect!&nbsp; I added a few appropriate overrides and the form reacts beautifully.&nbsp; Thanks a bunch!&nbsp; The tech tip was exactly what I needed.</DIV><DIV>&nbsp;</DIV><DIV>Take care,</DIV><DIV>Bill</DIV>]]>
   </description>
   <pubDate>Mon, 18 Jun 2007 14:41:41 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=88&amp;PID=180#180</guid>
  </item> 
  <item>
   <title>Updating Custom Properties : Check out the TechTip on Refreshing...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=88&amp;PID=179#179</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=34" rel="nofollow">jeffdoolittle</a><br /><strong>Subject:</strong> 88<br /><strong>Posted:</strong> 18-Jun-2007 at 2:07pm<br /><br />Check out the TechTip on Refreshing Dependent Parents:<br><br>http://www.ideablade.com/techtip_refreshing_dependent_parents.htm<br>]]>
   </description>
   <pubDate>Mon, 18 Jun 2007 14:07:18 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=88&amp;PID=179#179</guid>
  </item> 
  <item>
   <title>Updating Custom Properties : I have a set of tables in a master-detail...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=88&amp;PID=178#178</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=24" rel="nofollow">Linguinut</a><br /><strong>Subject:</strong> 88<br /><strong>Posted:</strong> 16-Jun-2007 at 11:16am<br /><br /><P>I have a set of tables in a master-detail relationship...let's call them orders and details for simplicity.&nbsp; In the orders entity I have added a custom property called TotalDetails.&nbsp; This iterates through the details related to the order and totals up the extended price (sum of price times quantity).&nbsp; Simple enough.&nbsp; Now, the details are displayed in a grid on the order form.&nbsp; If I change a price or quantity in the grid, I would expect the TotalDetails property to change.&nbsp; It doesn't.&nbsp; The&nbsp;property updates if I navigate away from the order and return to it.&nbsp; How do I get the custom property to update dynamically without changing entities?</P><P>Thanks!</P><P>Bill</P>]]>
   </description>
   <pubDate>Sat, 16 Jun 2007 11:16:36 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=88&amp;PID=178#178</guid>
  </item> 
 </channel>
</rss>