BindingManagerBase.SuspendBinding BindingManagerBase.SuspendBinding BindingManagerBase.SuspendBinding BindingManagerBase.SuspendBinding Method

定義

派生クラスでオーバーライドされると、データ連結を中断します。When overridden in a derived class, suspends data binding.

public:
 abstract void SuspendBinding();
public abstract void SuspendBinding ();
abstract member SuspendBinding : unit -> unit
Public MustOverride Sub SuspendBinding ()

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 );
   }
}
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);
   }
}
Private Sub button4_Click(sender As Object, e As EventArgs)
   Try
      Dim myBindingManager2 As BindingManagerBase = BindingContext(myDataSet, "Customers")
      myBindingManager2.ResumeBinding()
   Catch ex As Exception
      MessageBox.Show(ex.Source.ToString())
      MessageBox.Show(ex.Message.ToString())
   End Try
End Sub 'button4_Click

注釈

SuspendBindingResumeBindingは、データバインディングの一時的な中断と再開を可能にする2つのメソッドです。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. たとえば、ユーザーは、2番目のフィールドに従ってフィールドを変更する必要がある場合があります。それ以外の場合、最初のフィールドを検証すると、2番目のフィールドが "エラー" になります。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.

適用対象

こちらもご覧ください