Spread Windows Forms 17
Spread Windows Forms 17.0 Product Documentation / Developer's Guide / Customizing Interaction in Cells / Using Validation / Displaying Error Icons in Cells or Rows
In This Topic
    Displaying Error Icons in Cells or Rows
    In This Topic

    You can display error icons in cells or rows.

    Use the ShowCellErrors or ShowRowErrors property to specify whether you wish to display an error icon or a cell note indicator. Set the ErrorText property for the Cell class or Row class to specify the cell or row to display the error icon in. Set the value of the ErrorText property to "CellError" to display the error icon for a cell or "RowError" to specify the error icon for a row. The following image displays the error icon.

    Spreadsheet with an error icon

    You can display a cell note indicator instead of the error icon by setting ShowCellErrors or ShowRowErrors to false. The text you specify with the ErrorText property is then displayed in the cell note.

    Using Code

    1. Set the ShowCellErrors or ShowRowErrors property.
    2. Set the ErrorText property for the Cell or Row object.

    Example

    This example displays an error icon in the locked cell.

    CS
    Copy Code
    fpSpread1.ShowCellErrors = true;
    fpSpread1.Sheets[0].Cells[1, 1].ErrorText = "CellError";
    fpSpread1.Sheets[0].Cells[1, 1].Locked = true;
    
    ; 
    
    VB
    Copy Code
    fpSpread1.ShowCellErrors = True
    fpSpread1.Sheets(0).Cells(1, 1).ErrorText = "CellError"
    fpSpread1.Sheets(0).Cells(1, 1).Locked = True
    
    See Also