I have a bindingsource which is bound to entity.
normBindingSource.DataSource =
dowacodbEntities.norms.OrderBy(o1 => o1.UsePurpose_id).ThenBy(o2 => o2.Quantity);
Then a bindingsource is displayed in a datagridview. If I use dataset, I can call HasChanges() method to check if there are changes have been made by user. Moreover, I found context.ObjectStateManager.GetObjectStateEntries(…) seems to be what I am looking for but I don’t know how to use it.
My purpose is when user leaves form, there will be a message box shows : “There are some changes, would you like to save it before exit ?”
This is the best method so far :