Protected sheet skin

Posted by: mark on 23 November 2019, 11:26 pm EST

  • Posted 23 November 2019, 11:26 pm EST

    When I protect a sheet, the column and row header text fades out to an extent such that it is difficult to read. Any idea how I can prevent this from happening or how I can change the font for headers of a protected sheet.

    Thanks,
    Mark
  • Marked as Answer

    Replied 24 November 2019, 11:19 pm EST

    Hi Mark,

    To change the forecolor of header cells when the sheet is locked, please use the following code:
    foreach (FarPoint.Win.Spread.Column column in fpSpread1.ActiveSheet.ColumnHeader.Columns)
    {
    FarPoint.Win.Spread.Cell cell = fpSpread1.ActiveSheet.ColumnHeader.Cells[0, column.Index];
    cell.Locked = true;
    cell.Renderer = new GeneralCellType();
    cell.LockForeColor = Color.Black;
    }
    foreach (FarPoint.Win.Spread.Row row in fpSpread1.ActiveSheet.RowHeader.Rows)
    {
    FarPoint.Win.Spread.Cell cell = fpSpread1.ActiveSheet.RowHeader.Cells[row.Index, 0];
    cell.Locked = true;
    cell.Renderer = new GeneralCellType();
    cell.LockForeColor = Color.Black;
    }
    In addition to the above code, make sure to change LegacyBehaviors to Style.

    Also, attached is sample application for reference.

    Regards,
    Ruchir
    Spread_ProtectedSheet.zip
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels