<?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 : navigation to a parent</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : navigation to a parent</description>
  <pubDate>Tue, 21 Apr 2026 14:11:01 -700</pubDate>
  <lastBuildDate>Mon, 24 May 2010 20:32:57 -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=1832</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>navigation to a parent : Hey ... stuff happens.  But it...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1832&amp;PID=7014#7014</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=482" rel="nofollow">WardBell</a><br /><strong>Subject:</strong> 1832<br /><strong>Posted:</strong> 24-May-2010 at 8:32pm<br /><br /><P>Hey ... stuff happens. </P><DIV>But it wasn't an idle question because I don't know what string to pass to the PropertyChangedEventArgs for the manager.</DIV><DIV>&nbsp;</DIV><DIV>Anyway, the following code, which would go inside the Employee custom partial class, works&nbsp;for the "Employee.Manager" scenario we've discussed.</DIV><DIV>&nbsp;</DIV><DIV>Observe that I dreamed up a string to send as the "PropertyName" when I raise PropertyChanged on the manager (which I do via the EntityAspect.ForcePropertyChanged method).</DIV><DIV>&nbsp;</DIV><DIV>I feel strongly that this is not a wise idea. You be the judge.</DIV><DIV>&nbsp;</DIV><DIV>---</DIV><DIV>&nbsp;</DIV><DIV><PRE style="MARGIN: 0em">     <SPAN style="COLOR: #0000ff">protected</SPAN><SPAN style="COLOR: #000000">  <SPAN style="COLOR: #0000ff">override</SPAN><SPAN style="COLOR: #000000">  <SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">  OnPropertyChanged(System.ComponentModel.<SPAN style="COLOR: #2b91af">PropertyChangedEventArgs</SPAN><SPAN style="COLOR: #000000">  e) <SPAN style="COLOR: #000000">{</SPAN></PRE><PRE style="MARGIN: 0em">       <SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">  (HeardDirectReportChanged(e)) <SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000"> ;</PRE><PRE style="MARGIN: 0em">       <SPAN style="COLOR: #0000ff">base</SPAN><SPAN style="COLOR: #000000">.OnPropertyChanged(e);</PRE><PRE style="MARGIN: 0em">       RaiseManagerPropertyChanged();</PRE><PRE style="MARGIN: 0em">     <SPAN style="COLOR: #000000">}</SPAN></PRE><PRE style="MARGIN: 0em"> </PRE><PRE style="MARGIN: 0em">     <SPAN style="COLOR: #008000">// <SPAN style="COLOR: #00008b">Note: Don't recommend this approach at all. <SPAN style="COLOR: #008000"> </SPAN><SPAN style="COLOR: #000000"> </PRE><PRE style="MARGIN: 0em">     <SPAN style="COLOR: #008000">// PropertyChanged is not raised for every change to an employee.</SPAN><SPAN style="COLOR: #000000"> </PRE><PRE style="MARGIN: 0em">     <SPAN style="COLOR: #008000">// PropertyChanged not raised when entity changes are rolled back</SPAN><SPAN style="COLOR: #000000"> </PRE><PRE style="MARGIN: 0em">     <SPAN style="COLOR: #008000">// e.g., after IEditableObject.CancelEdit or RejectChanges</SPAN><SPAN style="COLOR: #000000"> </PRE><PRE style="MARGIN: 0em">     <SPAN style="COLOR: #008000">// Manager won't hear about any of these events via this mechanism</SPAN><SPAN style="COLOR: #000000"> </PRE><PRE style="MARGIN: 0em"> </PRE><PRE style="MARGIN: 0em">     <SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">  <SPAN style="COLOR: #0000ff">bool</SPAN><SPAN style="COLOR: #000000">  HeardDirectReportChanged(<SPAN style="COLOR: #2b91af">PropertyChangedEventArgs</SPAN><SPAN style="COLOR: #000000">  e) <SPAN style="COLOR: #000000">{</SPAN></PRE><PRE style="MARGIN: 0em">       <SPAN style="COLOR: #0000ff">var</SPAN><SPAN style="COLOR: #000000">  propertyName = e.PropertyName;</PRE><PRE style="MARGIN: 0em">       <SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">  (!propertyName.StartsWith(<SPAN style="COLOR: #a31515">"DirectReport '"</SPAN><SPAN style="COLOR: #000000"> )) <SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">  <SPAN style="COLOR: #0000ff">false</SPAN><SPAN style="COLOR: #000000"> ;</PRE><PRE style="MARGIN: 0em">       <SPAN style="COLOR: #008000">// Do something</SPAN><SPAN style="COLOR: #000000"> </PRE><PRE style="MARGIN: 0em">       <SPAN style="COLOR: #0000ff">var</SPAN><SPAN style="COLOR: #000000">  x = <SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.FullName + <SPAN style="COLOR: #a31515">" heard from "</SPAN><SPAN style="COLOR: #000000"> + propertyName;</PRE><PRE style="MARGIN: 0em">       <SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">  <SPAN style="COLOR: #0000ff">true</SPAN><SPAN style="COLOR: #000000"> ; <SPAN style="COLOR: #008000">// assume don't actually want to continue with PropertyChanged</SPAN><SPAN style="COLOR: #000000"> </PRE><PRE style="MARGIN: 0em">     <SPAN style="COLOR: #000000">}</SPAN></PRE><PRE style="MARGIN: 0em"> </PRE><PRE style="MARGIN: 0em">     <SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">  <SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">  RaiseManagerPropertyChanged() <SPAN style="COLOR: #000000">{</SPAN></PRE><PRE style="MARGIN: 0em">       <SPAN style="COLOR: #0000ff">var</SPAN><SPAN style="COLOR: #000000">  mgr = <SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.</SPAN>Manager;</PRE><PRE style="MARGIN: 0em">       <SPAN style="COLOR: #0000ff">var</SPAN><SPAN style="COLOR: #000000">  mgrEa = Manager.EntityAspect;</PRE><PRE style="MARGIN: 0em">       <SPAN style="COLOR: #0000ff">var</SPAN><SPAN style="COLOR: #000000">  selfEa = <SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.EntityAspect;</PRE><PRE style="MARGIN: 0em"> </PRE><PRE style="MARGIN: 0em">       <SPAN style="COLOR: #008000">// Reasons not to continue</SPAN><SPAN style="COLOR: #000000"> </PRE><PRE style="MARGIN: 0em">       <SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">  (<SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">  == mgr ||                      <SPAN style="COLOR: #008000">// if manage oneself</SPAN><SPAN style="COLOR: #000000"> </PRE><PRE style="MARGIN: 0em">            !selfEa.IsChanged ||                 <SPAN style="COLOR: #008000">// self unchanged</SPAN><SPAN style="COLOR: #000000"> </PRE><PRE style="MARGIN: 0em">            selfEa.EntityState.IsDetached() ||   <SPAN style="COLOR: #008000">// self is detached</SPAN><SPAN style="COLOR: #000000"> </PRE><PRE style="MARGIN: 0em">            mgrEa.IsNullEntity ||                <SPAN style="COLOR: #008000">// have no manager</SPAN><SPAN style="COLOR: #000000"> </PRE><PRE style="MARGIN: 0em">            mgrEa.EntityState.IsDetached()       <SPAN style="COLOR: #008000">// manager is detached</SPAN><SPAN style="COLOR: #000000"> </SPAN></PRE><PRE style="MARGIN: 0em">           ) <SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000"> ;<SPAN style="COLOR: #000000"></PRE><PRE style="MARGIN: 0em"> </PRE><PRE style="MARGIN: 0em"> </PRE><PRE style="MARGIN: 0em">       mgr.EntityAspect.ForcePropertyChanged(</PRE><PRE style="MARGIN: 0em">         <SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">  <SPAN style="COLOR: #2b91af">PropertyChangedEventArgs</SPAN><SPAN style="COLOR: #000000"> (</PRE><PRE style="MARGIN: 0em">           <SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000"> .Format(<SPAN style="COLOR: #a31515">"DirectReport '<SPAN style="COLOR: #000000">{</SPAN>0<SPAN style="COLOR: #000000">}</SPAN>: <SPAN style="COLOR: #000000">{</SPAN>1<SPAN style="COLOR: #000000">}</SPAN>'"</SPAN><SPAN style="COLOR: #000000"> , EmployeeID, FullName)));</PRE><PRE style="MARGIN: 0em">     <SPAN style="COLOR: #000000">}</SPAN></PRE></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></DIV><DIV>&nbsp;</DIV><DIV></DIV>]]>
   </description>
   <pubDate>Mon, 24 May 2010 20:32:57 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1832&amp;PID=7014#7014</guid>
  </item> 
  <item>
   <title>navigation to a parent : I am sorry I was not clear. But...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1832&amp;PID=7002#7002</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=643" rel="nofollow">downeytim</a><br /><strong>Subject:</strong> 1832<br /><strong>Posted:</strong> 24-May-2010 at 3:35am<br /><br />I am sorry I was not clear.&nbsp; But you raise some good questions as to why our legacy code does this.&nbsp; Be that as it may what I need to do is, using your example, when a property changes on an employee record (any property) I want to raise a property changed event on the manager.&nbsp; The property changing on the manager is the employee that changed in the first place. <DIV>&nbsp;</DIV><DIV>Does this make more sense?&nbsp; I don't really know what the scenario is that supports this as we are merely migrating legacy code to a new version of Ideablade and the DevExpress controls. </DIV>]]>
   </description>
   <pubDate>Mon, 24 May 2010 03:35:03 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1832&amp;PID=7002#7002</guid>
  </item> 
  <item>
   <title>navigation to a parent : Sorry I&amp;#039;m confused by the...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1832&amp;PID=6994#6994</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=477" rel="nofollow">ting</a><br /><strong>Subject:</strong> 1832<br /><strong>Posted:</strong> 21-May-2010 at 4:56pm<br /><br />Sorry I'm confused by the phrase "each of the parent of this child". Can&nbsp;you&nbsp;describe the object graph in greater detail? <DIV></DIV><DIV></DIV><DIV>&nbsp;&nbsp;</DIV><DIV>I think you are asking how to propagate a property change recursively down a<strong> single dependent navigation path</strong>.</DIV><DIV>&nbsp;</DIV><DIV>For example, a manager employee has "direct report" employees. Some of these might also be managers with their own "direct reports".</DIV><DIV>&nbsp;</DIV><DIV>You are proposing that a change to the CEO, say, should result in a property change raised on the CEO's direct reports, and then on their reports and so forth.</DIV><DIV>&nbsp;</DIV><DIV>If so, the next question is "<strong>what property name should be raised</strong>?" What do you want to have happen to each child and what should be passed down to the nex child?&nbsp; I'm not sure what repeatedly raising the "DirectReports" property, for example, is supposed to&nbsp;accomplish.</DIV><DIV>&nbsp;</DIV><DIV>I'm at a loss until I understand the scenario more clearly.</DIV><DIV>&nbsp;</DIV><span style="font-size:10px"><br /><br />Edited by ting - 21-May-2010 at 5:00pm</span>]]>
   </description>
   <pubDate>Fri, 21 May 2010 16:56:23 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1832&amp;PID=6994#6994</guid>
  </item> 
  <item>
   <title>navigation to a parent : I have a situation where a specific...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1832&amp;PID=6975#6975</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=643" rel="nofollow">downeytim</a><br /><strong>Subject:</strong> 1832<br /><strong>Posted:</strong> 20-May-2010 at 7:35am<br /><br />I have a situation where a specific entity has had a property change.&nbsp; I want to propagate that property change to each of the parent of this child.&nbsp; This child has children also.&nbsp; <DIV>&nbsp;</DIV><DIV>I tried getting the NavigationProperties of the entity and tried to figure out which were parent relations, but alas I can't seem to quite get it.&nbsp; Can you point me at some code to accomplish this?</DIV><DIV>&nbsp;</DIV><DIV>Thanks.</DIV>]]>
   </description>
   <pubDate>Thu, 20 May 2010 07:35:13 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1832&amp;PID=6975#6975</guid>
  </item> 
 </channel>
</rss>