SuspendBinding Method

BindingManagerBase.SuspendBinding Method ()

 

When overridden in a derived class, suspends data binding.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public abstract void SuspendBinding()

SuspendBinding and ResumeBinding are two methods that allow the temporary suspension and resumption of data binding. You would typically suspend data binding if the user must be allowed to edit data fields before validation occurs. For example, the user might need to change a field to be in accordance with a second field; otherwise, validating the first field would cause the second field to be in error.

private void button4_Click(object sender, EventArgs e)
{
   try
   {
      BindingManagerBase myBindingManager2=BindingContext [myDataSet, "Customers"];
      myBindingManager2.ResumeBinding();
   }
   catch(Exception ex)
   {
      MessageBox.Show(ex.Source);
      MessageBox.Show(ex.Message);
   }
}

.NET Framework
Available since 1.1
Return to top
Show:
© 2016 Microsoft