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


In This Topic
    EditError Event
    In This Topic
    Occurs when the user performs an invalid input operation.
    Syntax
    'Declaration
     
    Public Event EditError As EditErrorEventHandler
    'Usage
     
    Dim instance As FpSpread
    Dim handler As EditErrorEventHandler
     
    AddHandler instance.EditError, handler
    public event EditErrorEventHandler EditError
    Event Data

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

    PropertyDescription
    Gets the column index of the cell with the editor that raised the event.  
    Gets the type of edit error.  
    Gets the row index of the cell with the editor that raised the event.  
    Gets the view that contains the cell with the editor that raised the event.  
    Remarks

    This event is raised by the OnEditError method when the user performs an invalid input operation.

    An error can occur when the user attempts any of the following:

    • Interacts with a locked cell
    • Moves the focus to a restricted column
    • Moves the focus to a restricted row
    • Moves the focus to a cell that is located in both a restricted row and column
    • Types invalid data into a cell (in which case the event is sent when the user leaves the cell.)
    • Types in a check box cell

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

    Example
    This example raises the EditError event when the user performs an invalid input operation.
    fpSpread1.ActiveSheet.Cells[0, 0].Locked = true;
    fpSpread1.ActiveSheet.Cells[0, 0].BackColor = Color.Black;
    Label1.Text = "Double-click on the black cell. It is locked.  This will fire the event";
    
    private void fpSpread1_EditError(object sender, FarPoint.Win.Spread.EditErrorEventArgs e)
    {
         ListBox1.Items.Add(e.EditError.ToString());
    }
    FpSpread1.ActiveSheet.Cells(0, 0).Locked = True
    FpSpread1.ActiveSheet.Cells(0, 0).BackColor = Color.Black
    Label1.Text = "Double-click on the black cell. It is locked.  This will fire the event"
    
    Private Sub FpSpread1_EditError(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.EditErrorEventArgs) Handles FpSpread1.EditError
         ListBox1.Items.Add(e.EditError.ToString())
    End Sub
    
    See Also