I have a DataGridView bound to a bindingsource which is bound to a List
. The user clicks a row that goes to a form with textboxes, etc. The textboxes a
I made this function now. You can use like:
if (changedOrNew(myBindingSource)){
// Do something!
}
public bool changedOrNew(BindingSource bs){
EntityObject obj = (EntityObject)bs.Current;
if (obj==null)
return false;
return (obj.EntityState == EntityState.Detached ||
obj.EntityState == EntityState.Added ||
obj.EntityState == EntityState.Modified);
}