Recent

Author Topic: How to hide columns?  (Read 1483 times)

Jvan

  • Full Member
  • ***
  • Posts: 181
How to hide columns?
« on: October 25, 2020, 03:18:43 am »
I only want to show the firt 10 columns, so I need to hide the rest of them.

wp

  • Hero Member
  • *****
  • Posts: 11830
Re: How to hide columns?
« Reply #1 on: October 27, 2020, 10:20:17 am »
When you want to restrict the number of rows and column usable in the WorksheetGrid you must set the property AutoExpand to [aeDefault] -- then the WorksheetGrid behaves like TStringGrid, i.e. you define the extent of the grid by setting its ColCount and RowCount properties. You cannot navigate beyond these limits, and you only can access cells within these limits. Adding aeData to the set automatically expands the grid when cells are written outside, and adding aeNavigate exands the grid when the user navigates with the arrow keys beyond the limits.

Please read https://wiki.lazarus.freepascal.org/TsWorksheetGrid#New_grid_properties

 

TinyPortal © 2005-2018