バージョン 24.2 (最新)

OwnerDataError イベント

データソースの特定の値が無効なときに発生します。
シンタックス
public event OwnerDataErrorEventHandler OwnerDataError
イベント データ

イベント ハンドラが、このイベントに関連するデータを含む、OwnerDataErrorEventArgs 型の引数を受け取りました。次の OwnerDataErrorEventArgs プロパティには、このイベントの固有の情報が記載されます。

プロパティ解説
BoundValue Infragistics.Win.UltraWinSchedule.DataErrorEventArgsBaseから継承されます。バインドされたフィールドから取得した変換後の値を返します。
MemberName Infragistics.Win.UltraWinSchedule.DataErrorEventArgsBaseから継承されます。エラーの原因である、バインドされたフィールドの名前を返します。
Message Infragistics.Win.UltraWinSchedule.DataErrorEventArgsBaseから継承されます。エンドユーザーに表示されるメッセージを取得または設定します。
Owner 無効なデータを含むデータ行を持つ Owner への参照を返します。
PropertyId データバインディングが無効な値を返した Owner プロパティのプロパティ ID を返します。
ShowMessageBox Infragistics.Win.UltraWinSchedule.DataErrorEventArgsBaseから継承されます。データバインディングエラーが発生したときにMessageBoxを表示するかどうかを示します。
使用例
Private Sub ultraCalendarInfo1_OwnerDataError(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinSchedule.OwnerDataErrorEventArgs) Handles ultraCalendarInfo1.OwnerDataError

      If e.PropertyId = OwnersDataBindingPropertyId.KeyMember Then
          'Get the new key
          Dim newOwnerKey As String = e.BoundValue.ToString()

          'See if the key already exists in the collection
          If Me.ultraCalendarInfo1.Owners.Exists(newOwnerKey) Then
              'Cancel the default message box
              e.ShowMessageBox = False

              'Show a custom error message
              Dim SB As New System.Text.StringBuilder()
              SB.AppendFormat("There is already an owner with key: {0}{1}This owner in the data source cannot be displayed by UltraWinSchedule.", newOwnerKey, Environment.NewLine)
              MessageBox.Show(Me, SB.ToString(), "Owner cannot be displayed")
          End If
      End If
  End Sub
'宣言
 
Public Event OwnerDataError As OwnerDataErrorEventHandler
 
private void ultraCalendarInfo1_OwnerDataError(object sender, Infragistics.Win.UltraWinSchedule.OwnerDataErrorEventArgs e)
{
	if ( e.PropertyId == OwnersDataBindingPropertyId.KeyMember )
	{
		//Get the new key
		string newOwnerKey = e.BoundValue.ToString();

		//See if the key already exists in the collection
		if ( this.ultraCalendarInfo1.Owners.Exists( newOwnerKey ) )
		{				
			//Cancel the default message box
			e.ShowMessageBox = false;

			//Show a custom error message
			System.Text.StringBuilder SB = new System.Text.StringBuilder();
			SB.AppendFormat( "There is already an owner with key: {0}\nThis owner in the data source cannot be displayed by UltraWinSchedule.", newOwnerKey);
			MessageBox.Show(this, SB.ToString(), "Owner cannot be displayed");
		}
	}
}
'宣言
 
Public Event OwnerDataError As OwnerDataErrorEventHandler
 
参照