Version

OwnerDataError Event

Fired when specific value in data source is invalid.
Syntax
'Declaration
 
Public Event OwnerDataError As OwnerDataErrorEventHandler
public event OwnerDataErrorEventHandler OwnerDataError
Event Data

The event handler receives an argument of type OwnerDataErrorEventArgs containing data related to this event. The following OwnerDataErrorEventArgs properties provide information specific to this event.

PropertyDescription
BoundValue (Inherited from Infragistics.Win.UltraWinSchedule.DataErrorEventArgsBase)Returns the converted value retrieved from the bound field.
MemberName (Inherited from Infragistics.Win.UltraWinSchedule.DataErrorEventArgsBase)Returns the name of the bound field whose value caused the error to occur.
Message (Inherited from Infragistics.Win.UltraWinSchedule.DataErrorEventArgsBase)Gets/sets the message that will be displayed to the end user.
Owner Returns a reference to the Owner whose corresponding data row contains invalid data.
PropertyId Returns the property identifier that describes the Owner property whose data binding returned an invalid value.
ShowMessageBox (Inherited from Infragistics.Win.UltraWinSchedule.DataErrorEventArgsBase)Determines whether a MessageBox is displayed when a data binding error occurs.
Example
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
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");
		}
	}
}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also