Making column headers appear disabled

Posted by: j2associates on 8 September 2017, 1:33 pm EST

  • Posted 8 September 2017, 1:33 pm EST

    Hello all,


    We have a situation where the number of key columns is entered by the user into a text box. Based upon that value, we then allow them to enter the key column names into a 1 row spread with columns labeled KeyColumn1, Separator1, KeyColumn2, Separator2, etc. What I would like to is to display the same empty spread regardless of the number of key columns requrested. The difference would be that if only 1 key column was requested, then Separator1, KeyColumn2, Separator2, etc would all display in the light gray disabled control color. I would also lock the corresponding cells as well. What is the best way to accomplish this? Should I just set the individual ColumnHeader cell ForeColor property? Do I need to set a sheet level protection property before locking individual cells? Thanks in advance for any ideas and/or suggestions!

  • Replied 8 September 2017, 1:33 pm EST

    Hello,


    All you need to do is set the Locked property for the column and columnheader you want disabled.


    FpSpread1.Sheets(0).Columns(1).Locked = True


    FpSpread1.Sheets(0).ColumnHeader.Cells(0, 1).Locked = True

  • Replied 8 September 2017, 1:33 pm EST

    Perfect! Thanks ScottS! I wouldn't have thought of locking the column header.
Need extra support?

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

Learn More

Forum Channels