バージョン

SuspendBindingNotifications メソッド

IBindingList関連の通知を一時停止します。これは、多数の変更を行う場合に、このデータソースにバインドされたコントロールがデータソース変更に関連するイベントを一時的に処理しないようにするときに役立ちます。
シンタックス
'宣言
 
Public Sub SuspendBindingNotifications() 
public void SuspendBindingNotifications()
解説

このメソッドを SuspendBindingNotifications と共に使用すると、UltraDataSource から ListChanged ItemChanged 通知が発生するのを一時的に中断できます。この方法は、大量のセルを変更する必要がある場合に、効率上の理由から変更対象のすべてのセルでListChanged ItemChanged通知を発生させたくないときに役立ちます。このような場合は、SuspendBindingNotifications を呼び出し、セルを変更してから、ResumeBindingNotifications を呼び出します。ResumeBindingNotificationsを呼び出すと、影響を受けたすべての行コレクションに対してUltraDataSourceから1つのListChanged Reset通知が発生し、その結果、バインドされたコントロールでデータが再読み込みされます。再開時に ResumeBindingNotifications から通知が発生しないようにするには、fireNotifications パラメーターを受け取る ResumeBindingNotifications のオーバー読み込みを使用します。ただし、fireNotificationsパラメーターにFalseを指定した場合、バインドされたコントロールで、変更されたセル値が反映されない場合があります。それらのコントロールは手動で無効にする必要があります。

注: データソース UltraGrid にバインドされる必要がある場合には、UltraGrid は ItemChanged 通知を受け取らないため、修正する行に対して InitializeRow イベントを発生しません。

,
使用例
Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinDataSource
Imports Infragistics.Win.UltraWinGrid


    Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
        ' SuspendBindingNotifications and ResumeBindingNotifications are used when
        ' performing a large number of updates to the data. What it does is that it
        ' prevents the UltraDataSource from firing ListChanged notifications on the
        ' IBindingList implementation so any bound controls do not process the 
        ' individual changes. When ResumeBindingNotifications is called, 
        ' UltraDataSource will fire ListChanged with Reset as the type specifying
        ' to the bound controls that they should reget the data for all rows. This
        ' can be more efficient than firing notifications for individual changes
        ' when there are lot of changes being made.
        '
        Try
            ' Suspend IBindingList ListChanged notifications.
            Me.UltraDataSource1.SuspendBindingNotifications()

            ' Value of BindingNotificationsSuspended property should be true after
            ' calling SuspendBindingNotifications method.
            Debug.WriteLine("Binding Notifications Suspended: " & Me.UltraDataSource1.BindingNotificationsSuspended)

            Dim row As UltraDataRow
            Dim column As UltraDataColumn
            For Each row In Me.UltraDataSource1.Rows
                For Each column In row.Band.Columns
                    row(column) = DBNull.Value
                Next
            Next
        Finally
            ' Resume ListChanged notifications.
            Me.UltraDataSource1.ResumeBindingNotifications()
        End Try
    End Sub
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinDataSource;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;
		private void button1_Click(object sender, System.EventArgs e)
		{
			// SuspendBindingNotifications and ResumeBindingNotifications are used when
			// performing a large number of updates to the data. What it does is that it
			// prevents the UltraDataSource from firing ListChanged notifications on the
			// IBindingList implementation so any bound controls do not process the 
			// individual changes. When ResumeBindingNotifications is called, 
			// UltraDataSource will fire ListChanged with Reset as the type specifying
			// to the bound controls that they should reget the data for all rows. This
			// can be more efficient than firing notifications for individual changes
			// when there are lot of changes being made.
			//
			try
			{
				// Suspend IBindingList ListChanged notifications.
				this.ultraDataSource1.SuspendBindingNotifications( );

				// Value of BindingNotificationsSuspended property should be true after
				// calling SuspendBindingNotifications method.
				Debug.WriteLine( "Binding Notifications Suspended: " + this.ultraDataSource1.BindingNotificationsSuspended );

				foreach ( UltraDataRow row in this.ultraDataSource1.Rows )
				{
					foreach ( UltraDataColumn column in row.Band.Columns )
					{
						row[ column ] = DBNull.Value;
					}
				}
			}
			finally
			{
				// Resume ListChanged notifications.
				this.ultraDataSource1.ResumeBindingNotifications( );				
			}
		}
参照