Merged cells support for the Lazarus grids
Original Reporter info from Mantis: wp @wpam
-
Reporter name:
Original Reporter info from Mantis: wp @wpam
- Reporter name:
Description:
The Lazarus grids have an option goColSpanning which prepares them for merged cells support. For an implementation, however, several protected methods must be overridden in a derived class (see merged_cells demo in examples/gridexamples) which makes that effort appear unfinished.
The attached patch is an initial implementation how merged cells could be introduced in TCustomGrid even at designtime. Unlike the above-mentioned demo project the information which cells are merged is not made available via an event, but is stored in a collection MergedBlocks. This way the user can add merged blocks at designtime using the standard collection component editor. Moreover, for stringgrids, the component editor was extended to facilitate working with merged cells: For merging select the group of cells to be merged and click "Merge", to unmerge select the merged group and click "Unmerge").
Additional information:
At the moment there are still some issues (fixed cell painting glitch when a vertically merged block is selected, collection MergedBlocks does not show up in object tree, plus some more), but I would like to address them only when it is clear that the patch is accepted.
Mantis conversion info:
- Mantis ID: 34180