Dedect pending changes in DLinq DataContext

  • Thread starter Thread starter Andrus
  • Start date Start date
A

Andrus

I have invoice editing WinForms form containing TextBox controls and
DataGridView.
Text boxes are bound to entity properties, grid is bound to BindingList of
entities.
Entitites are returned from DLinq query and implement
INotifyPropertyChanged.

If user closes form I need to check for unsaved changes are present and
prompt user to save them.

How to check that DataContext has pending changes ?
I havent found such function.
So should I add property IsDirty to form and set/reset it manually by
trapping every property change event ?
Or is it possible to examine DataContext for pending changes ?

Andrus.
 
Andrus said:
I have invoice editing WinForms form containing TextBox controls and
DataGridView.
Text boxes are bound to entity properties, grid is bound to
BindingList of entities. Entitites are returned from DLinq query and
implement INotifyPropertyChanged.

If user closes form I need to check for unsaved changes are present
and prompt user to save them.

How to check that DataContext has pending changes ?
I havent found such function.
So should I add property IsDirty to form and set/reset it manually by
trapping every property change event ? Or is it possible to examine
DataContext for pending changes ?

datacontext.GetChangedSet() ?

FB

--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
 
Back
Top