<?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 : Data Binding in Windows Form</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Data Binding in Windows Form</description>
  <pubDate>Mon, 13 Apr 2026 14:39:59 -700</pubDate>
  <lastBuildDate>Wed, 11 Jul 2012 11:11:13 -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=3531</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>Data Binding in Windows Form :   Hi,Have you taken a look at...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3531&amp;PID=14000#14000</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> 3531<br /><strong>Posted:</strong> 11-Jul-2012 at 11:11am<br /><br />Hi,<div>&nbsp;</div><div>Have you taken a look at our WinForms sample? You can download it in the <a href="http://drc.ideablade.com/xwiki/bin/view/&#068;ocumentati&#111;n/code-sample-win&#102;orms-walk" target="_blank">DevForce Resource Center</a>.</div><div>&nbsp;</div><div>Regards,</div><div>&nbsp;&nbsp; Silvio.</div>]]>
   </description>
   <pubDate>Wed, 11 Jul 2012 11:11:13 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3531&amp;PID=14000#14000</guid>
  </item> 
  <item>
   <title>Data Binding in Windows Form : I have using DevForce create small...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3531&amp;PID=13995#13995</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1480" rel="nofollow">duyhungb5</a><br /><strong>Subject:</strong> 3531<br /><strong>Posted:</strong> 11-Jul-2012 at 2:59am<br /><br />I have using DevForce create small Application in WinForm<div>But I have Problem I can't binding data in Form Load Event Athough When Form display If I click Button call to Method Binding then Data is binding to Data Grid View.</div><div><div>&nbsp;EmployeeModel viewModel;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; public Form1()</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; InitializeComponent();</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; viewModel = new EmployeeModel();</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div><br></div><div><span ="Apple-tab-span" style="white-space:pre">	</span>//Event Is Ok</div><div>&nbsp; &nbsp; &nbsp; &nbsp; private void button1_Click(object sender, EventArgs e)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.employeeBindingSource.DataSource = viewModel.Employees;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.dataGridView1.DataSource = null;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.dataGridView1.DataSource = this.employeeBindingSource;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div><br></div><div><span ="Apple-tab-span" style="white-space:pre">	</span>//Event Is not Display Data in Data GridView</div><div>&nbsp; &nbsp; &nbsp; &nbsp; private void Form1_Load(object sender, EventArgs e)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.dataGridView1.DataSource = viewModel.Employees;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dataGridView1.Refresh(); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div></div><div><br></div><div>I have create class using DevForce</div><div><div>public class EmployeeModel : INotifyPropertyChanged</div><div>&nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; #region "Define Variable"</div><div>&nbsp; &nbsp; &nbsp; &nbsp; private NorthwindEntities _mgr = new NorthwindEntities();</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; public ObservableCollection&lt;Employee&gt; Employees { get; private set; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; public ObservableCollection&lt;string&gt; Log { get; private set; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; #endregion</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; #region "Property Event"</div><div>&nbsp; &nbsp; &nbsp; &nbsp; public event PropertyChangedEventHandler PropertyChanged = delegate { };</div><div>&nbsp; &nbsp; &nbsp; &nbsp; #endregion</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; #region "Define Property"</div><div>&nbsp; &nbsp; &nbsp; &nbsp; private string _busyPropertyName;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; private bool _isBusy;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; public bool IsBusy</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; get { return _isBusy; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _isBusy = value; RaisePropertyChanged(_busyPropertyName);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; public bool IsOrderBusy { get { return _isBusy; } }</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; private Employee _currentEmployee;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; public Employee CurrentEmployee</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; get { return _currentEmployee; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set { _currentEmployee = value; RaisePropertyChanged("CurrentEmployee"); }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div><br></div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; private int _currentPosition = -1;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; public int CurrentPosition</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; get { return _currentPosition; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (Employees != null &amp;&amp; Employees.Count &gt; 0)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _currentPosition = Math.Min(Math.Max(value, 0), Employees.Count - 1);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CurrentEmployee = Employees&#091;_currentPosition&#093;;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _currentPosition = -1;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CurrentEmployee = null;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; RaisePropertyChanged("CurrentPosition");</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; private bool _hasChanges = false;</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; public bool HasChanges</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; get { return _hasChanges; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; private set</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _hasChanges = value;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; RaisePropertyChanged("HasChanges");</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div><br></div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; private EntityQuery&lt;Employee&gt; _query;</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; #endregion</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; #region "Construction"</div><div>&nbsp; &nbsp; &nbsp; &nbsp; public EmployeeModel()</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Employees = new ObservableCollection&lt;Employee&gt;();</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Employees.CollectionChanged += Employees_CollectionChanged;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Log = new ObservableCollection&lt;string&gt;();</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _busyPropertyName = "IsBusy";&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _mgr.Fetching += (s, e) =&gt;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IsBusy = true;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WriteToLog(e.Query);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; };</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _mgr.Queried += (s, e) =&gt;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IsBusy = false;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _busyPropertyName = "IsOrderBusy";</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WriteToLog("Query returned " + e.Results.Cast&lt;object&gt;().Count());</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; };</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //_mgr.EntityChanged += (s, args) =&gt; HasChanges = ((NorthwindEntities)s).HasChanges();</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _query = _mgr.Employees;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var op = _query.ExecuteAsync();</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; op.Completed += GotEmployees;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //_query.ExecuteAsync(</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;op =&gt;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (op.HasError)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;throw new InvalidOperationException("Query failed: " + op.Error);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;op.Results.ForEach(Employees.Add);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CurrentEmployee = Employees.FirstOrDefault();</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}); &nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; #endregion</div><div><br></div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; #region "Write Log"</div><div>&nbsp; &nbsp; &nbsp; &nbsp; private void WriteToLog(IEntityQuery query)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var returnType = query.ElementType;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var message = (returnType == typeof(Order))</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ? "Fetching Orders from Employee " + CurrentEmployee.EmployeeID</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : "Fetching " + returnType;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WriteToLog(message);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; private void WriteToLog(string message)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Log.Insert(0, message);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; #endregion</div><div><br></div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; #region "Entity Method"</div><div>&nbsp; &nbsp; &nbsp; &nbsp; private void GotEmployees(object sender, EntityQueriedEventArgs&lt;Employee&gt; args)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (args.HasError)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;throw new InvalidOperationException("Query failed: " + args.Error);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; args.Results.ForEach(Employees.Add);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CurrentEmployee = Employees.FirstOrDefault();</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; public void Save()</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _mgr.SaveChangesAsync();</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; private void Add(System.Collections.Generic.IEnumerable&lt;Employee&gt; employees)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //_mgr.AddEntities(employees);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //Save();</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //employees.ForEach(_mgr.AddEntity);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (employees.Any(emp =&gt; emp.EntityAspect.EntityState.IsDetached()))</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _mgr.AddEntities(employees);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; private void Delete(IEnumerable&lt;Employee&gt; employees)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; employees.ForEach(emp =&gt; emp.EntityAspect.Delete());</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Save();</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; private void Employees_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; switch (e.Action)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case NotifyCollectionChangedAction.Add:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Add(e.NewItems.Cast&lt;Employee&gt;());</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case NotifyCollectionChangedAction.Remove:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Delete(e.OldItems.Cast&lt;Employee&gt;());</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; public void RollbackChanges()</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int privateCurrentPosition = CurrentPosition;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _mgr.RejectChanges();</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Employees.Clear();</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _query.With(QueryStrategy.CacheOnly).Execute().ForEach(Employees.Add);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CurrentPosition = privateCurrentPosition;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; #endregion</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; #region "Private Method"</div><div>&nbsp; &nbsp; &nbsp; &nbsp; private void RaisePropertyChanged(string property)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PropertyChanged(this, new PropertyChangedEventArgs(property));</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; void _mgr_Fetching(object sender, EntityFetchingEventArgs e)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WriteToLog("Fetching " + e.Query.ElementType);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; #endregion</div><div><br></div><div>&nbsp; &nbsp; }</div></div><div><br><div><br></div></div>]]>
   </description>
   <pubDate>Wed, 11 Jul 2012 02:59:45 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3531&amp;PID=13995#13995</guid>
  </item> 
 </channel>
</rss>