Spread Windows Forms 13.0 Product Documentation
FarPoint.Win.Spread Assembly / FarPoint.Win.Spread Namespace / FpSpread Class / Error Event

In This Topic
    Error Event
    In This Topic
    Occurs when the user performs an invalid operation.
    Public Event Error As ErrorEventHandler
    Dim instance As FpSpread
    Dim handler As ErrorEventHandler
    AddHandler instance.Error, handler
    public event ErrorEventHandler Error
    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.

    Gets or sets whether to cancel default processing and throw exceptions or the EditError event.  
    Gets the column index of the cell with the editor that raised the event.  
    Gets the right column index that raised the event.  
    Gets the type of edit error.  
    Gets the text description of the error.  
    Gets the exception thrown by the error.  
    Determines whether the error is an editing error.  
    Gets the row index of the cell with the editor that raised the event.  
    Gets the bottom row index of the cell that raised the event.  
    Gets the view that contains the cell with the editor that raised the event.  

    This event is raised by the OnError method when the user leaves a cell.

    For more details on the individual event arguments, refer to ErrorEventArgs members.

    This example raises the PaintTabStripButton event.
    void FpSpread1_Error(object sender, ErrorEventArgs e)
          if ((e.EditError == FarPoint.Win.Spread.EditError.InvalidCellData))
                if ((e.IsEditError == true))
                      e.Cancel = true;
                      e.View.Sheets[0].Cells[e.Row, e.Column].BackColor = Color.Red;
    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
                      e.View.Sheets(0).Cells(e.Row, e.Column).BackColor = Color.Red
                End If
          End If
    End Sub
    See Also