Recent

Author Topic: how to limit or statically fix the number of rows and columns in a grid  (Read 3237 times)

witenite

  • New Member
  • *
  • Posts: 41
When using FPSpreadsheet, how can I go about fixing the number of columns/rows. I am well aware of RowCount and ColCount, and they work in terms of bringing the grid down to a clearly defined size, however if the user scrolls down or right, new rows/columns are dynamically added to the grid. How do I inhibit that sort of user action/interaction with my grid? Is there an existing flag I can disable to do this, or do I need to write a procedural event to capture an attempt to scroll outside of the boundaries of the grid?

wp

  • Hero Member
  • *****
  • Posts: 11916
Re: how to limit or statically fix the number of rows and columns in a grid
« Reply #1 on: February 15, 2017, 12:48:42 am »
Please see "AutoExpand" in http://wiki.lazarus.freepascal.org/TsWorksheetGrid#New_grid_properties.
  • Turn off aeNavigation if you don't want the user to navigate outside the predefined grid size.
  • Turn off aeData if you don't want to write cells outside the predefined grid size (attempting this would raise an exception then).
  • Turn off aeDefault if you have several sheets, use the same grid in a TsWorkbookTabControl, and don't want smaller grids to expand to default size (set by DEFAULT_ROW_COUNT and DEFAULT_COL_COUNT).
« Last Edit: February 20, 2017, 09:44:32 am by wp »

witenite

  • New Member
  • *
  • Posts: 41
Re: how to limit or statically fix the number of rows and columns in a grid
« Reply #2 on: February 20, 2017, 09:21:55 am »
Thanks! Exactly what I was looking for. Found more details online too here:
http://wiki.freepascal.org/TsWorksheetGrid#Merged_cells

 

TinyPortal © 2005-2018