<?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 : Refresh Collection</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Refresh Collection</description>
  <pubDate>Thu, 30 Jul 2026 00:46:29 -700</pubDate>
  <lastBuildDate>Tue, 31 May 2011 12:05:33 -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=2722</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>Refresh Collection : Thanks for the info. I&amp;#039;m...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2722&amp;PID=10869#10869</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=912" rel="nofollow">DenisK</a><br /><strong>Subject:</strong> 2722<br /><strong>Posted:</strong> 31-May-2011 at 12:05pm<br /><br /><div style=": rgb255, 255, 255; margin-left: 1px; margin-top: 1px; margin-right: 1px; margin-bottom: 1px; font-family: Verdana, Arial, Helvetica, sans-serif; color: rgb0, 0, 0; font-weight: normal; font-size: 12px; line-height: 1.4; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; -: n&#111;ne; "><div>Thanks for the info. I'm not claiming to be a binding expert but I'm going to try and help you as best as I can.</div><div><br></div><div>First off, I'm still missing some bits and pieces of information here.</div><div><br></div><div><table width="99%"><tr><td class="BBquote"></div><div><span ="Apple-style-span" style="-webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px; ">yes, i m editing the currently selected ViewEmployee, and when click OK, it will save the changes.</span></div><div></td></tr></table></div><div><br></div><div>So here, you're saying that a window does pop up with the currently selected ViewEmployee and when you click OK, it will save the changes. Could you post some code showing how you're creating this window and what you're binding it to?</div><div><br></div><div><div style="-webkit-border-horiz&#111;ntal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "><table width="99%"><tr><td class="BBquote"></div><div><span ="Apple-style-span" style="-webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px; ">My question is do I need to to re-fetch the data again GridView to show the changes?</span></div><div style="-webkit-border-horiz&#111;ntal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "></td></tr></table></div></div><div style="-webkit-border-horiz&#111;ntal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "><br></div><div style="-webkit-border-horiz&#111;ntal-spacing: 0px; -webkit-border-vertical-spacing: 0px; ">The simple answer here is no, provided that the implementation is correct.</div><div style="-webkit-border-horiz&#111;ntal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "><br></div><div><div style="-webkit-border-horiz&#111;ntal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "><table width="99%"><tr><td class="BBquote"></div><div><span ="Apple-style-span" style="-webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px; ">or since&nbsp;<i>&nbsp;I have&nbsp;</i>implemented the RaisePropertyChanged on Collection 'GridViewCllection' in the viewmodel, that will automatically notifiy the grid to reflect the changes?</span></div><div style="-webkit-border-horiz&#111;ntal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "></td></tr></table></div></div><div style="-webkit-border-horiz&#111;ntal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "><br></div><div style="-webkit-border-horiz&#111;ntal-spacing: 0px; -webkit-border-vertical-spacing: 0px; ">I'm not sure I understand this part. I believe an ObservableCollection&lt;T&gt; already implements the INotifyPropertyChanged interface. Can I see your RaisePropertyChanged implementation as well?</div><div style="-webkit-border-horiz&#111;ntal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "><br></div><div><div style="-webkit-border-horiz&#111;ntal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "><table width="99%"><tr><td class="BBquote"></div><div><span ="Apple-style-span" style="-webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px; ">when I try the same using Database View( to populate GridView) it is not showing updates.</span></div><div style="-webkit-border-horiz&#111;ntal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "></td></tr></table></div></div><div style="-webkit-border-horiz&#111;ntal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "><br></div><div style="-webkit-border-horiz&#111;ntal-spacing: 0px; -webkit-border-vertical-spacing: 0px; ">I'm not sure I understand this part either. Could you elaborate?</div><div style="-webkit-border-horiz&#111;ntal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "><br></div><div style="-webkit-border-horiz&#111;ntal-spacing: 0px; -webkit-border-vertical-spacing: 0px; ">If it's okay with you, you can also upload your entire solution (hopefully it's still small), so you don't need to keep posting code snippets.</div><div style="-webkit-border-horiz&#111;ntal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "><br></div><div style="-webkit-border-horiz&#111;ntal-spacing: 0px; -webkit-border-vertical-spacing: 0px; ">Here are some links that should be helpful to you as you're implementing a sandbox editor. The main advice here is that you don't save the changes to the database when you click OK but rather, you use a temporary EntityManager and use ImportEntities to import the updated ViewEmployee back to the main EntityManager.</div><div style="-webkit-border-horiz&#111;ntal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "><br></div><div style="-webkit-border-horiz&#111;ntal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "><a href="http://drc.ideablade.com/xwiki/bin/view/&#068;ocumentati&#111;n/multiple-entitymanagers" target="_blank">http://drc.ideablade.com/xwiki/bin/view/Documentation/multiple-entitymanagers</a></div><div style="-webkit-border-horiz&#111;ntal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "><a href="http://neverindoubtnet.blogspot.com/2010_12_01_archive.html" target="_blank">http://neverindoubtnet.blogspot.com/2010_12_01_archive.html</a></div></div>]]>
   </description>
   <pubDate>Tue, 31 May 2011 12:05:33 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2722&amp;PID=10869#10869</guid>
  </item> 
  <item>
   <title>Refresh Collection : Hello,yes, i m editing the currently...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2722&amp;PID=10857#10857</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1159" rel="nofollow">new user</a><br /><strong>Subject:</strong> 2722<br /><strong>Posted:</strong> 30-May-2011 at 3:25am<br /><br />Hello,<br><br>yes, i m editing the currently selected ViewEmployee, and when click OK, it will save the changes. My question is do I need to to re-fetch the data again GridView to show thechanges? or since&nbsp;<i> I have </i>implemented the RaisePropertyChanged on Collection 'GridViewCllection' in the viewmodel, that will automatically notifiy the grid to reflect the changes? But the second option is not working.<br><br>But When I re-fetch the data again to GridView, it is showing updates. and also when I try the same using Database View( to populate GridView) it is not showing updates.<br>]]>
   </description>
   <pubDate>Mon, 30 May 2011 03:25:02 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2722&amp;PID=10857#10857</guid>
  </item> 
  <item>
   <title>Refresh Collection : Hi new user;You said that you...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2722&amp;PID=10851#10851</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=912" rel="nofollow">DenisK</a><br /><strong>Subject:</strong> 2722<br /><strong>Posted:</strong> 27-May-2011 at 11:57am<br /><br />Hi new user;<div><br></div><div>You said that you have a button outside the grid. What exactly does that button do? Does it open up a new window where you can edit the currently selected ViewEmployee, and when you click OK, it will save the changes?</div><div><br></div><div>Regarding your MyCommand implementation, the re-querying should be done after the SaveChangesAsync is completed. Remember that this is an asynchronous operation.</div><div><br></div><div><table width="99%"><tr><td><pre class="BBcode"></div><div><span ="Apple-style-span" style="-webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px; ">MyCommand = new RelayCommand&lt;EventArgs&gt;(e =&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // my code to update<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mgr.SaveChangesAsync(saveOp =&gt; {</span></div><div><span ="Apple-style-span" style="-webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px; ">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span></div><div><span ="Apple-style-span" style="-webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px; "><span ="Apple-tab-span" style="white-space:pre">		</span>&nbsp; &nbsp;if(saveOp.CompletedSuccessfully) {<br><span ="Apple-tab-span" style="white-space:pre">	</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;GridViewCollection .Clear();<br>&nbsp; &nbsp; &nbsp; &nbsp; <span ="Apple-tab-span" style="white-space:pre">	</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;var Query = mgr.ViewEmployees.Where(i =&gt; i.EmpSalary&gt;100000);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span ="Apple-tab-span" style="white-space:pre">	</span>&nbsp; &nbsp;Query.ExecuteAsync(op =&gt; op.Results.ForEach(GridViewCollection.Add));</span></div><div><span ="Apple-style-span" style="-webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px; "><span ="Apple-tab-span" style="white-space:pre">		</span>&nbsp; &nbsp;}</span></div><div><span ="Apple-style-span" style="-webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px; "><span ="Apple-tab-span" style="white-space:pre">		</span></span></div><div><span ="Apple-style-span" style="-webkit-border-horiz&#111;ntal-spacing: 1px; -webkit-border-vertical-spacing: 1px; "><span ="Apple-tab-span" style="white-space:pre"></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; });<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></div><div></pre></td></tr></table></div>]]>
   </description>
   <pubDate>Fri, 27 May 2011 11:57:44 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2722&amp;PID=10851#10851</guid>
  </item> 
  <item>
   <title>Refresh Collection : Hello,I have a RadGridView like...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2722&amp;PID=10833#10833</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1159" rel="nofollow">new user</a><br /><strong>Subject:</strong> 2722<br /><strong>Posted:</strong> 26-May-2011 at 8:53am<br /><br />&nbsp;Hello,<br>&nbsp;<br>&nbsp;I have a RadGridView like below. It is populated using a Observabale collection of type 'ViewEmployee' which is a View. And I have a button outside GridView. clicking on that button I need to change some data in GridView(update corresponding entity). But after updation it is not refreshing the GridView.<br>&nbsp;How could I refresh GridView or Collection.<br><br>&nbsp; &nbsp; &lt;telerik:RadGridView&nbsp; x:Name="RadGridView1"&nbsp; ItemsSource="{Binding GridViewCollection, Mode=TwoWay}" AutoGenerateColumns="False" &gt;<br>&nbsp;&nbsp;&nbsp;&nbsp; &lt;telerik:RadGridView.Columns&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;telerik:GridViewDataColumn DataMemberBinding="{Binding EmpID}" /&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;telerik:GridViewDataColumn DataMemberBinding="{Binding EmpName}" /&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp; &lt;/telerik:RadGridView.Columns&gt;<br>&nbsp;&lt;/telerik:RadGridView&gt;<br>&nbsp;<br>ViewModel:-<br><br>&nbsp;&nbsp; public ObservableCollection&lt;ViewEmployee&gt; GridViewCollection { get; private set; }<br>&nbsp;&nbsp; <br>&nbsp;&nbsp; public MyViewModel()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GridViewCollection = new ObservableCollection&lt;ViewEmployee&gt;();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var Query = mgr.ViewEmployees.Where(i =&gt; i.EmpSalary&gt;100000);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Query.ExecuteAsync(op =&gt; op.Results.ForEach(GridViewCollection.Add));<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br><br><br>I have tried the following code after changing the data. It is updating data in corresponding entity, but not in GridView. Once I close the applicationn and again reopen it shows the changes in GridView. Is that because I have used View to populate GridView?<br><br>&nbsp;MyCommand = new RelayCommand&lt;EventArgs&gt;(e =&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // my code to update<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mgr.SaveChangesAsync();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GridViewCollection .Clear();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var Query = mgr.ViewEmployees.Where(i =&gt; i.EmpSalary&gt;100000);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Query.ExecuteAsync(op =&gt; op.Results.ForEach(GridViewCollection.Add));<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br><br>Please help.<br>Thanks.<br>]]>
   </description>
   <pubDate>Thu, 26 May 2011 08:53:27 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2722&amp;PID=10833#10833</guid>
  </item> 
 </channel>
</rss>