<?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 : Bindable LINQ query</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Bindable LINQ query</description>
  <pubDate>Wed, 22 Apr 2026 08:59:46 -700</pubDate>
  <lastBuildDate>Tue, 07 Sep 2010 18:33:21 -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=2112</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>Bindable LINQ query : The ObservableCollection is bindable,...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2112&amp;PID=8392#8392</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=892" rel="nofollow">sbelini</a><br /><strong>Subject:</strong> 2112<br /><strong>Posted:</strong> 07-Sep-2010 at 6:33pm<br /><br /><DIV>The ObservableCollection is bindable, but it only reflects the changes done to itself.</DIV><DIV>To monitor to any other changes you might want to use the EntityListManager:</DIV><DIV><FONT face=C&#111;nsolas><FONT size=2><FONT face=Verdana></FONT></FONT></FONT>&nbsp;</DIV><DIV><FONT face=C&#111;nsolas><FONT size=2><FONT face=Verdana>##################</DIV><DIV></FONT>&nbsp;</DIV><DIV>var filter = new Predicate&lt;Customer&gt;(delegate(Customer aCustomer) {return aCustomer.CompanyName.StartsWith("C");});</FONT></DIV><DIV><FONT size=2>var elm = new&nbsp;EntityListManager&lt;Customer&gt;(mgr, filter, null);</FONT></DIV><DIV><FONT size=2>elm.ManageList(bindableList, true);<BR></FONT></FONT><FONT face=""></FONT></DIV><DIV><FONT face="">##################</FONT></DIV><DIV>&nbsp;</DIV><DIV>This way, any changes made to any&nbsp;Customer matching the criteria above with reflect in bindableList (regardless of if it was made in bindableList or not).</DIV>]]>
   </description>
   <pubDate>Tue, 07 Sep 2010 18:33:21 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2112&amp;PID=8392#8392</guid>
  </item> 
  <item>
   <title>Bindable LINQ query :  Silvio, your code for ToObservableCollection...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2112&amp;PID=8390#8390</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=919" rel="nofollow">kpozin</a><br /><strong>Subject:</strong> 2112<br /><strong>Posted:</strong> 07-Sep-2010 at 3:19pm<br /><br />Silvio, your code for <font face="Courier New, Courier, mono">ToObservableCollection</font> does not seem to create any binding to the query. What will cause new items added to the <font face="Courier New, Courier, mono">Customers</font> entity set to also appear in <font face="Courier New, Courier, mono">bindableList</font> after the <font face="Courier New, Courier, mono">bindableList</font> is initialized?<br>]]>
   </description>
   <pubDate>Tue, 07 Sep 2010 15:19:30 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2112&amp;PID=8390#8390</guid>
  </item> 
  <item>
   <title>Bindable LINQ query : Hi,   DevForce&amp;#039;s LINQ-to-Entities...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2112&amp;PID=8389#8389</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=892" rel="nofollow">sbelini</a><br /><strong>Subject:</strong> 2112<br /><strong>Posted:</strong> 07-Sep-2010 at 3:12pm<br /><br />Hi, <DIV>&nbsp;</DIV><DIV>DevForce's LINQ-to-Entities does support bindable query results indeed.</DIV><DIV>&nbsp;</DIV><DIV>You can have bidirectional bindable query results by using ObservableCollection.</DIV><DIV>&nbsp;</DIV><DIV>While the reladedEntityList is not intended to be used&nbsp;to wrap a query (it's intended to be used as the return value of a collection navigation property), you can do that with ObservableCollection as well.</DIV><DIV>&nbsp;</DIV><DIV>A suggestion would be creating a "ToObservableCollection" extension method, so you could use like this:</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>##################</DIV><DIV>&nbsp;</DIV><FONT size=2 face=C&#111;nsolas>var bindableList = _em1.Customers<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Where(c =&gt; c.CompanyName.StartsWith("C"))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .ToObservableCollection();</FONT> <DIV>&nbsp;</DIV><DIV>##################</DIV><DIV><strong></strong>&nbsp;</DIV><DIV><strong></strong>&nbsp;</DIV><DIV>The extension method would look like this (please note that the code below does not do any error checking):</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>##################</DIV><DIV><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas><P></FONT></FONT><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#0000ff size=2 face=C&#111;nsolas><FONT color=#000000 size=2 face=C&#111;nsolas>public static ObservableCollection&lt;T&gt; ToObservableCollection&lt;T&gt;(this IEnumerable&lt;T&gt; items) {<BR>&nbsp; var result = new ObservableCollection&lt;T&gt;();<BR>&nbsp; foreach (var each in items) {<BR>&nbsp;&nbsp;&nbsp; result.Add(each);<BR>&nbsp; }<BR>&nbsp; return result;<BR>}</P><DIV></FONT></FONT></FONT>##################</DIV></DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>You might also be interested in knowing about the EntityListManager, so you could monitor the entire cache to any changes that could affect bindableList (but made directly into it). You can find more information about the EntityListManager&nbsp;in the <a href="http://drc.ideablade.com/xwiki/bin/view/&#068;ocumentati&#111;n/TheEntityListManager" target="_blank">DevForce Resource&nbsp;Center</A>.</DIV>]]>
   </description>
   <pubDate>Tue, 07 Sep 2010 15:12:34 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2112&amp;PID=8389#8389</guid>
  </item> 
  <item>
   <title>Bindable LINQ query : Does DevForce&amp;#039;s LINQ-to-Entities...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2112&amp;PID=8301#8301</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=919" rel="nofollow">kpozin</a><br /><strong>Subject:</strong> 2112<br /><strong>Posted:</strong> 31-Aug-2010 at 3:08pm<br /><br />Does DevForce's LINQ-to-Entities have any support for bindable query results?<br>That is, if I select some entity objects using LINQ, is there any way to ensure that the collection that holds the result will implement <font face="Courier New, Courier, mono">INotifyCollectionChanged </font>and will be bidirectionally bindable?<br>Is there, for example, a way to wrap a <font face="Courier New, Courier, mono">RelatedEntityList </font>around a query?<br>]]>
   </description>
   <pubDate>Tue, 31 Aug 2010 15:08:11 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2112&amp;PID=8301#8301</guid>
  </item> 
 </channel>
</rss>