Occurs when the user performs an invalid operation.
Syntax
Event Data
The event handler receives an argument of type ErrorEventArgs containing data related to this event. The following ErrorEventArgs properties provide information specific to this event.
Property | Description |
---|
Cancel | Gets or sets whether to cancel default processing and throw exceptions or EditError event. |
Column | Gets the column index of the cell with the editor that raised the event. |
EditError | Gets the type of edit error. |
ErrorMessage | Gets the text description of the error. |
Exception | Gets the exception thrown by the error. |
IsEditError | Determines whether the error is an editing error. |
Row | Gets the row index of the cell with the editor that raised the event. |
View | Gets the view that contains the cell with the editor that raised the event. |
Remarks
Example
This example raises the PaintTabStripButton event.
C# | Copy Code |
---|
void FpSpread1_Error(object sender, ErrorEventArgs e)
{
if ((e.EditError == FarPoint.Win.Spread.EditError.InvalidCellData))
{
if ((e.IsEditError == true))
{
e.Cancel = true;
MessageBox.Show(e.ErrorMessage);
e.View.Sheets[0].Cells[e.Row, e.Column].BackColor = Color.Red;
}
}
} |
Visual Basic | Copy Code |
---|
Private Sub fpSpread1_Error(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.ErrorEventArgs) Handles fpSpread1.Error
If e.EditError = Win.Spread.EditError.InvalidCellData Then
If e.IsEditError = True Then
e.Cancel = True
MessageBox.Show(e.ErrorMessage)
e.View.Sheets(0).Cells(e.Row, e.Column).BackColor = Color.Red
End If
End If
End Sub |
Requirements
Target Platforms: 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