示例#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();
     }
 }
示例#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();
         }
     }
 }