<?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 : Binding to and managing collection navigation properties</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Binding to and managing collection navigation properties</description>
  <pubDate>Wed, 29 Jul 2026 13:06:41 -700</pubDate>
  <lastBuildDate>Thu, 13 Jan 2011 15:20:11 -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=2437</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>Binding to and managing collection navigation properties : I received an email with some...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2437&amp;PID=9645#9645</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> 2437<br /><strong>Posted:</strong> 13-Jan-2011 at 3:20pm<br /><br />I received an email with some perceptive questions. Here is that email and my response: <DIV>&nbsp;</DIV><DIV>=== The Questions ===</DIV><DIV>&nbsp;</DIV><DIV><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><FONT size=3 face=Calibri><EM>Would you say that if a view has a grid, the grid should most always be populated by a parent.child relationship such as Member.Invoices instead of an ObservableCollection such as Invoices?</EM></FONT></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><?: prefix = o ns = "urn:schemas-microsoft-com:office:office" /><O:P><FONT size=3 face=Calibri><EM>&nbsp;</EM></FONT></O:P></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><FONT size=3 face=Calibri><EM>After the save of a child entity using the above parent.child relationship how do I tell the data binding to refresh the view because a new entity has been added to the grid? </EM></FONT></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><O:P><FONT size=3 face=Calibri><EM>&nbsp;</EM></FONT></O:P></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><FONT size=3 face=Calibri><EM>Would I raise OnPropertyChanged(“”) ; should the property name be “ Member.Invoices” ?</P><DIV></EM></FONT>&nbsp;</DIV><DIV>===&nbsp; My Reply ===</DIV><DIV>&nbsp;</DIV><DIV><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><FONT face=Calibri><FONT size=3><EM>Would you say that if a view has a grid, the grid <SPAN style="mso-highlight: yellow; yellow: ">should most always be populated by a parent.child relationship</SPAN> such as Member.Invoices instead of an ObservableCollection such as Invoices?<O:P></O:P></EM></FONT></FONT></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><O:P><FONT size=3 face=Calibri>&nbsp;</FONT></O:P></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><FONT face=Calibri><FONT size=3><B style="mso-bidi-font-weight: normal"><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2">No, I would not say that</SPAN></B><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2">. In fact, I would ONLY display a child collection in the grid if the grid were ReadOnly. <O:P></O:P></SPAN></FONT></FONT></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><O:P><FONT size=3 face=Calibri>&nbsp;</FONT></O:P></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><FONT face=Calibri><FONT size=3>I feel rather strongly that Member.Invoices.Add and Member.Invoices.Remove should never be called and I would have removed them from the public API if I could. Why? Because I think business logic should guard whether a child can be added or removed from a parent and there is no way known to me for injecting that logic into the Add and Remove (we’re considering interceptors for these methods in a future version but haven’t received enough votes to do it.)<O:P></O:P></FONT></FONT></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><O:P><FONT size=3 face=Calibri>&nbsp;</FONT></O:P></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><FONT face=Calibri><FONT size=3>You can set the navigation property “read only” both in the model and at the entity instance levels.<O:P></O:P></FONT></FONT></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><O:P><FONT size=3 face=Calibri>&nbsp;</FONT></O:P></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><FONT face=Calibri><FONT size=3>A collection navigation property such as Member.Invoices returns a DevForce RelatedEntityList&lt;T&gt; (T being an Invoice in this case). The RelatedEntityList&lt;T&gt; has a IsReadOnly property that you can set to true. When ‘true’, the Add and Remove methods throw an exception. <O:P></O:P></FONT></FONT></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><O:P><FONT size=3 face=Calibri>&nbsp;</FONT></O:P></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><FONT face=Calibri><FONT size=3>You don’t need the Add/Remove property. When you set the child entity’s parent FK, DevForce adds (or removes) the child entity to the parent RelatedEntityList for you. Thus writing “newInvoice.Member = someMember” <SPAN style="mso-spacerun: yes">&nbsp;</SPAN>automatically adds the “newInvoice” to the “someMember.Invoices” collection.<O:P></O:P></FONT></FONT></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><O:P><FONT size=3 face=Calibri>&nbsp;</FONT></O:P></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><FONT face=Calibri><FONT size=3>This puts YOU, the DEVELOPER, in the position of determining whether or not this newInvoice is allowed to be an invoice of that Member. You can add pre-set validation rules to Invoice.Member (and Invoice.MemberID) properties that prevent invalid invoices from joining the invoice of “someMember”.<O:P></O:P></FONT></FONT></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><BR><FONT face=Calibri><FONT size=3>If I were being thorough I personally would <O:P></O:P></FONT></FONT></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><O:P><FONT size=3 face=Calibri>&nbsp;</FONT></O:P></SPAN></P><P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" ="MsoListParagraph"><SPAN style="FONT-FAMILY: Symbol; COLOR: #1f497d; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol; mso-themecolor: dark2"><SPAN style="mso-list: Ignore"><FONT size=3>·</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><FONT face=Calibri><FONT size=3>Force the Member.Invoices collection to always be read only (see how below)<O:P></O:P></FONT></FONT></SPAN></P><P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" ="MsoListParagraph"><SPAN style="FONT-FAMILY: Symbol; COLOR: #1f497d; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol; mso-themecolor: dark2"><SPAN style="mso-list: Ignore"><FONT size=3>·</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><FONT face=Calibri><FONT size=3>Make the setter of Invoice.Member and Invoice.MemberID “internal”<O:P></O:P></FONT></FONT></SPAN></P><P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" ="MsoListParagraph"><SPAN style="FONT-FAMILY: Symbol; COLOR: #1f497d; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol; mso-themecolor: dark2"><SPAN style="mso-list: Ignore"><FONT size=3>·</FONT><SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><FONT face=Calibri><FONT size=3>Add “AddInvoice” and “RemoveInvoice” methods to “Member”; these methods can set the “newInvoice.Member” if and when it has determined that “newInvoice” can be added to the member’s invoices.<O:P></O:P></FONT></FONT></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><O:P><FONT size=3 face=Calibri>&nbsp;</FONT></O:P></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><FONT size=3><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><FONT face=Calibri>All of this is me being extra careful about the business rules and semantics of my application model. I’m not sure ANY CUSTOMER has ever been this careful. Most don’t write any validations at all. But your question gave me the excuse to explain how I think it OUGHT to be done even if almost no one does it </FONT></SPAN><SPAN style="FONT-FAMILY: Wingdings; COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2; mso-symbol-font-family: Wingdings; mso-char-: symbol"><SPAN style="mso-symbol-font-family: Wingdings; mso-char-: symbol">J</SPAN></SPAN><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><O:P></O:P></SPAN></FONT></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><O:P><FONT size=3 face=Calibri>&nbsp;</FONT></O:P></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><FONT size=3><FONT face=Calibri>--<O:P></O:P></FONT></FONT></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><O:P><FONT size=3 face=Calibri>&nbsp;</FONT></O:P></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><FONT size=3><FONT face=Calibri>If you want to ensure that a collection navigation property is always read only, you can declare that intent while refining the model. Here’s a snap shot of the EF Model Browser property window where you flip the “Is collection read only” property.<O:P></O:P></FONT></FONT></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><O:P><FONT size=3 face=Calibri>&nbsp;</FONT></O:P></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2; mso-no-proof: yes"><?: prefix = v ns = "urn:schemas-microsoft-com:vml" /><V:SHAPE id=_x0000_t75 stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"><V:STROKE joinstyle="miter"></V:STROKE><V:ULAS><V:F eqn="if lineDrawn pixelLineWidth 0"></V:F><V:F eqn="sum @0 1 0"></V:F><V:F eqn="sum 0 0 @1"></V:F><V:F eqn="prod @2 1 2"></V:F><V:F eqn="prod @3 21600 pixelWidth"></V:F><V:F eqn="prod @3 21600 pixelHeight"></V:F><V:F eqn="sum @0 0 1"></V:F><V:F eqn="prod @6 1 2"></V:F><V:F eqn="prod @7 21600 pixelWidth"></V:F><V:F eqn="sum @8 21600 0"></V:F><V:F eqn="prod @7 21600 pixelHeight"></V:F><V:F eqn="sum @10 21600 0"></V:F></V:ULAS><V:PATH gradientshapeok="t" o:extrusi&#111;nok="f" o:c&#111;nnect="rect"></V:PATH><O:LOCK aspectratio="t" v:ext="edit"></O:LOCK></V:SHAPE></SPAN><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><O:P></O:P></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><O:P><FONT size=3 face=Calibri><img src="http://www.ideablade.com/forum/uploads/482/NavCollecti&#111;nIsRead&#079;nly.png" height="445" width="857" border="0" />&nbsp;</FONT></O:P></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><FONT size=3><FONT face=Calibri>When set true, DevForce set the IsReadOnly property to ‘true’ when it constructs the RelatedEntityList&lt;T&gt; for a navigation property of an entity instance.<O:P></O:P></FONT></FONT></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; mso-themecolor: dark2"><O:P><FONT size=3 face=Calibri>&nbsp;</FONT></O:P></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><FONT size=3><FONT face=Calibri>===========<O:P></O:P></FONT></FONT></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><O:P><FONT size=3 face=Calibri>&nbsp;</FONT></O:P></SPAN></P><FONT size=3><FONT face=Calibri><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><FONT size=3 face=Calibri><EM>After the save of a child entity using the above parent.child relationship how do I tell the data binding to refresh the view because a new entity has been added to the grid? </EM></FONT></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"></FONT></FONT><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><O:P><FONT size=3 face=Calibri>&nbsp;</FONT></O:P></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><FONT size=3><FONT face=Calibri>You seem to be talking about what to do after saving a NEW entity rather than saving changes to an EXISTING entity that is already in the Member.Invoices.<O:P></O:P></FONT></FONT></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><O:P><FONT size=3 face=Calibri>&nbsp;</FONT></O:P></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><FONT size=3><FONT face=Calibri>The view should pick up on this if (a) the new entity is/was added to the bound collection and (b) the bound collection implements INotifyCollectionChanged (as RelatedEntityList&lt;T&gt; does).<O:P></O:P></FONT></FONT></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><O:P><FONT size=3 face=Calibri>&nbsp;</FONT></O:P></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><FONT size=3><FONT face=Calibri>Let’s assume that the MemberID of the new invoice has been set to the ID of the Member whose invoices are on display. As explained above, DevForce automatically adds the new entity to Member.Invoices because that collection navigation property is a RelatedEntityList&lt;Invoice&gt;; the DevForce EntityManager watches that list and automatically adds/removes invoices that qualify/do-not-qualify for the list. Per the assumption, the new invoice qualifies.<O:P></O:P></FONT></FONT></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><O:P><FONT size=3 face=Calibri>&nbsp;</FONT></O:P></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><FONT size=3><FONT face=Calibri>There is no such automatic mechanism for ObservableCollection&lt;T&gt;. You will have to add and remove items from the OC yourself unless …<O:P></O:P></FONT></FONT></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><O:P><FONT size=3 face=Calibri>&nbsp;</FONT></O:P></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><FONT size=3><FONT face=Calibri>… unless you decide to manage the OC with a DevForce EntityListManager. An EntityListManager can maintains a list in the same manner as DevForce does the RelatedEntityList&lt;T&gt;. This is an “advanced” DevForce option which you might find useful here. <O:P></O:P></FONT></FONT></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><O:P><FONT size=3 face=Calibri>&nbsp;</FONT></O:P></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><FONT size=3><FONT face=Calibri>On the other hand, many folks don’t like the “magic” of the EntityListManager and will choose to add/remove from the OC programmatically.<O:P></O:P></FONT></FONT></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; mso-themecolor: dark2"><O:P><FONT size=3 face=Calibri>&nbsp;</FONT></O:P></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><FONT size=3><FONT face=Calibri>=======<O:P></O:P></FONT></FONT></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><O:P><FONT size=3 face=Calibri>&nbsp;</FONT></O:P></SPAN></P><FONT size=3><FONT face=Calibri><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><FONT size=3 face=Calibri><EM>Would I raise OnPropertyChanged(“”) ; should the property name be “ Member.Invoices” ?</P><DIV></EM></FONT></FONT></FONT><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><O:P><FONT size=3 face=Calibri>&nbsp;</FONT></O:P></SPAN></DIV><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><FONT size=3><FONT face=Calibri>Raising it for “Member.Invoices” would be telling the view that the collection OBJECT ITSELF had been replaced which is not so. What has really happened is that the collection CONTENTS have changed. <O:P></O:P></FONT></FONT></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><O:P><FONT size=3 face=Calibri>&nbsp;</FONT></O:P></SPAN></P><P style="MARGIN: 0in 0in 0pt" ="Ms&#111;normal"><SPAN style="COLOR: #1f497d; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"><FONT size=3><FONT face=Calibri>The view should know this automatically because the collection returned by Member.Invoices is a RelatedEntityList&lt;Invoice&gt; which implements INotifyCollectionChanged.<O:P></O:P></FONT></FONT></SPAN></P></DIV></DIV><span style="font-size:10px"><br /><br />Edited by WardBell - 13-Jan-2011 at 3:20pm</span>]]>
   </description>
   <pubDate>Thu, 13 Jan 2011 15:20:11 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2437&amp;PID=9645#9645</guid>
  </item> 
 </channel>
</rss>