Recent

Author Topic: [SOLVED] WorkSheetGrid, merged cells and picklist  (Read 1082 times)

morknot

  • Jr. Member
  • **
  • Posts: 51
  • still learning
[SOLVED] WorkSheetGrid, merged cells and picklist
« on: July 15, 2024, 01:48:43 pm »
I have a WorkSheetGrid which has a number of merged cells. I would like to use a Picklist on some merged cells and for the picklist to span the merged cells. The Picklist itself is only visible in the first cell of the merged group because the SelectEditor 'acol' value is always the first cell column. Therefore the values are truncated and not readable.

Is it possible to have a Picklist which visually spans merged cells?

Thanks!
« Last Edit: July 16, 2024, 11:36:10 am by morknot »

wp

  • Hero Member
  • *****
  • Posts: 12459
Re: WorkSheetGrid, merged cells and picklist
« Reply #1 on: July 15, 2024, 03:12:52 pm »
I don't know how you activate the picklist editor and thus cannot give a specific answer. Obviously your code does not extend the cell rect to cover the range of the merged cells. Please study the code of TsCustomWorksheetGrid.DoEditorShow in fpspreadsheetgrid; it shows how to measure the extent of the merged cells. Use this in Editor.SetBounds to define the size of the cell editor in this particular cell.

paweld

  • Hero Member
  • *****
  • Posts: 1268
Re: WorkSheetGrid, merged cells and picklist
« Reply #2 on: July 15, 2024, 03:23:00 pm »
Attached is a modified example of fpsgrid - a new event added: WorksheetGridSelectEditor.
Best regards / Pozdrawiam
paweld

morknot

  • Jr. Member
  • **
  • Posts: 51
  • still learning
Re: [SOLVED] WorkSheetGrid, merged cells and picklist
« Reply #3 on: July 16, 2024, 11:39:44 am »
Thank you wp and paweld for your solutions. I now have picklists which span merged cells!

Regards

 

TinyPortal © 2005-2018