<?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 : PagedCollectionView and AddNew</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2009 : PagedCollectionView and AddNew</description>
  <pubDate>Tue, 28 Apr 2026 22:59:42 -700</pubDate>
  <lastBuildDate>Wed, 18 Nov 2009 08:17:28 -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=1444</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>PagedCollectionView and AddNew : I think your earlier method of...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1444&amp;PID=5827#5827</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=496" rel="nofollow">zinovate</a><br /><strong>Subject:</strong> 1444<br /><strong>Posted:</strong> 18-Nov-2009 at 8:17am<br /><br />I think your earlier method of catching the CollectionChanged Event is going to be a good route. Testing it now...<DIV>Ben</DIV>]]>
   </description>
   <pubDate>Wed, 18 Nov 2009 08:17:28 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1444&amp;PID=5827#5827</guid>
  </item> 
  <item>
   <title>PagedCollectionView and AddNew : What if you are using the PagedCollection...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1444&amp;PID=5826#5826</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=496" rel="nofollow">zinovate</a><br /><strong>Subject:</strong> 1444<br /><strong>Posted:</strong> 18-Nov-2009 at 7:22am<br /><br />What if you are using the PagedCollection directly? Editing works great but add new items is a challenge. <DIV>What is the best practice for adding entities when using the paged view? (and is it not reccomended).</DIV>]]>
   </description>
   <pubDate>Wed, 18 Nov 2009 07:22:05 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1444&amp;PID=5826#5826</guid>
  </item> 
  <item>
   <title>PagedCollectionView and AddNew : You call the entity.Create method,...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1444&amp;PID=5258#5258</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 1444<br /><strong>Posted:</strong> 26-Aug-2009 at 9:55pm<br /><br />You call the entity.Create method, it's not something DevForce itself calls, or anything that will be called by an external class during entity construction. &nbsp; Doing a Create and then a List.Add sounds OK - you're basically taking the AddNew processing away from the PCV. &nbsp; Since the PCV won't be aware of the new item, you'll also need to ensure that CancelNew and CommitNew processing are handled correctly - or maybe ignored if everything is now an edit of an existing item.]]>
   </description>
   <pubDate>Wed, 26 Aug 2009 21:55:44 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1444&amp;PID=5258#5258</guid>
  </item> 
  <item>
   <title>PagedCollectionView and AddNew : Thank you for the quick reply....</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1444&amp;PID=5253#5253</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=531" rel="nofollow">midnit</a><br /><strong>Subject:</strong> 1444<br /><strong>Posted:</strong> 26-Aug-2009 at 10:52am<br /><br />Thank you for the quick reply. Our entity.Create method actually adds itself to the EntityManager so perhaps it wont fit well with this scenario.<DIV></DIV><DIV>&nbsp;</DIV><DIV>So...I have gone back to calling .Add on the source List which seems to be working fine. Do you know of any short comings of doing it this way based on the fact that our .Create adds itself to the EntityManager already?</DIV>]]>
   </description>
   <pubDate>Wed, 26 Aug 2009 10:52:35 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1444&amp;PID=5253#5253</guid>
  </item> 
  <item>
   <title>PagedCollectionView and AddNew : The AddNew() logic in the standard...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1444&amp;PID=5252#5252</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 1444<br /><strong>Posted:</strong> 26-Aug-2009 at 10:40am<br /><br />The AddNew() logic in the standard Silverlight PagedCollectionView calls the default constructor for the type, adds the new object to the collection, and then if it's an IEditableObject calls BeginEdit().&nbsp; Unfortunately, in DevForce we currently require that the entity is already&nbsp;attached to an EntityManager before allowing BeginEdit to proceed.<DIV>&nbsp;</DIV><DIV>This is a hack, but to work around the problem you can listen for CollectionChanged events on the PCV.&nbsp; In your handler if the Action is Add you can then add the entity to an EntityManager.&nbsp; This is taking advantage of the fact that the CollectionChanged event fires before the BeginEdit call.</DIV><DIV>&nbsp;</DIV><DIV>The DevForce PagedCollectionView does do the AddEntity logic for you when AddNew() is called, but the DevForce PCV has some other issues and may not be suitable for you, at least in release 5.2.1.</DIV>]]>
   </description>
   <pubDate>Wed, 26 Aug 2009 10:40:03 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1444&amp;PID=5252#5252</guid>
  </item> 
  <item>
   <title>PagedCollectionView and AddNew : I was previously using an IList...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1444&amp;PID=5249#5249</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=531" rel="nofollow">midnit</a><br /><strong>Subject:</strong> 1444<br /><strong>Posted:</strong> 26-Aug-2009 at 8:58am<br /><br />I was previously using an IList in my VM to bind my grid to. Today I attempted to change things around as I have found I have need to sorting the underlying data from the VM so I created a PagedCollectionView. This worked well until I tried to use .AddNew in which case I got an error stating "Cannot call BeginEdit() on Deleted or Detached entities". Based on the MSDN description of AddNew I expected it to do the same as List.Add(entity) but obviously the mechanics and different.<DIV>&nbsp;</DIV><DIV>Can you advise me in a solution? Should I use the underlying list to do the add or is there a "proper" way of doing it with the PagedCollectionView. The entities I am trying to "add" have their own .Create method which worked well for the list. I also saw a snippit that you may have implemented an IPagedCollectionView, this is not what I am using. I am using the System.Windows.Data.</DIV><DIV>&nbsp;</DIV><DIV>Thank you for your time,</DIV><DIV>-Robert</DIV>]]>
   </description>
   <pubDate>Wed, 26 Aug 2009 08:58:10 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1444&amp;PID=5249#5249</guid>
  </item> 
 </channel>
</rss>