Exemplo n.º 1
0
 private void UnbindBindingSource(BindingSource source)
 {
     System.ComponentModel.IEditableObject current =
         this.dataListBindingSource.Current as System.ComponentModel.IEditableObject;
     this.dataListBindingSource.DataSource = null;
     if (current != null)
     {
         current.EndEdit();
     }
 }
Exemplo n.º 2
0
 protected void UnbindBindingSource(BindingSource source, bool apply, bool isRoot)
 {
     System.ComponentModel.IEditableObject current =
         source.Current as System.ComponentModel.IEditableObject;
     if (isRoot)
     {
         source.DataSource = null;
     }
     if (current != null)
     {
         if (apply)
         {
             current.EndEdit();
         }
         else
         {
             current.CancelEdit();
         }
     }
 }