DataRepeaterDataErrorEventArgs Class

 

Provides data for the DataError event.

Namespace:   Microsoft.VisualBasic.PowerPacks
Assembly:  Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)

System.Object
  System.EventArgs
    Microsoft.VisualBasic.PowerPacks.DataRepeaterDataErrorEventArgs

public class DataRepeaterDataErrorEventArgs : EventArgs

NameDescription
System_CAPS_pubmethodDataRepeaterDataErrorEventArgs(DataRepeaterItem, Control, String, Exception)

Initializes a new instance of the DataRepeaterDataErrorEventArgs class.

NameDescription
System_CAPS_pubpropertyControl

Gets the Control that raised the data error.

System_CAPS_pubpropertyDataRepeaterItem

Gets the DataRepeaterItem that raised the data error.

System_CAPS_pubpropertyException

Gets the Exception that represents the error.

System_CAPS_pubpropertyPropertyName

Gets the name of the property of the control that raised the error.

System_CAPS_pubpropertyThrowException

Gets or sets a value that indicates whether to throw an exception after code execution exits the DataError event handler.

NameDescription
System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_protmethodFinalize()

(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethodToString()

(Inherited from Object.)

The DataError event enables you to handle exceptions that are thrown in code that is called by a DataRepeater control during data processing operations.

The following example demonstrates how to use the data from a DataRepeaterDataErrorEventArgs to display a message when a data error occurs.

private void dataRepeater1_DataError(object sender, 
    Microsoft.VisualBasic.PowerPacks.DataRepeaterDataErrorEventArgs e)
{
    string ErrorMsg;
    // Create an error string.
    ErrorMsg = "Invalid value entered for " + e.Control.Name + ". ";
    ErrorMsg = ErrorMsg + e.Exception.Message;
    // Display the error to the user.
    MessageBox.Show(ErrorMsg);
    // Do not raise an exception.
    e.ThrowException = false;
}

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: