Spread 8.0 Documentation
ColMerge Property
Support Options
ActiveX Reference > ActiveX Properties > ColMerge Property

Glossary Item Box

ColMerge Property


See Also    DLL    Example

Applies To

fpSpread control

Description

Sets or returns whether or how cells in a column that have the same content are grouped in a single cell spanning multiple rows. This property is available at run time only.

Syntax

C++

long CSpreadSheet::GetColMerge( );
void CSpreadSheet::SetColMerge(long value);

Visual Basic

[form.]fpSpread.ColMerge[ = setting%]

Remarks

The following settings are available:

Setting Description Constants
0 - None (Default) Cells with the same content are not merged MergeNone
1 - Always Cells with the same content are always merged MergeAlways
2 - Restricted Cells with the same content are merged only when adjacent cells to the left are also merged MergeRestricted

This setting is applied to the current sheet setting unless you first set the Sheet property to specify the sheet for which you are setting the property. Set the Col property before setting the ColMerge property to specify the column for which you are setting the merge behavior.

If a merged column overlaps a span then the merged column replaces the span. It is recommended that merging and spanning not be used on the same sheet.

Note: You cannot set the Col property to –1 to specify that all columns allow merging. You must specify the merge setting for each column individually.

The following figure illustrates setting 2 (Restricted). In the figure, column A is set to 1 (Always) and column B is set to 2 (Restricted). As shown in the figure, the cells in column B merge only when the cells immediately to the left of them are also merged. Cell B1 would merge with cells B2 and B3 if the user typed "birds" in cell A1.

Merged cells take on the properties of the top-left merged cell. For example, if the top-left merged cell has a blue background color, the cells that merge with it display the same background color.

Merged cells do not lose their data; it is simply hidden by the merge. If you remove the merge, for example, by setting the ColMerge property to 0 (None), the data appears in each cell that was in the merge. You can edit a cell that is merged with another cell. When you double-click the cell to turn edit mode on, the contents of the cell appear in the cell for you to edit them. When you leave edit mode, if the contents of the cell are no longer identical to the cell or cells with which it was previously merged, the cells are no longer displayed as merged.

Cells that are different cell types but have the same contents can merge. For example, a date cell might contain the contents "01/31/02" and the adjacent edit cell might contain the same contents; if the column containing the cells is set to merge, the cells will merge. If the contents change or the merge is removed, the cells maintain their cell types as well as their data.

Use the RowMerge property to specify whether and how to merge cells that have the same content in a row.

Spread Designer

Choose the Sheet menu, then the Columns and Rows menu, select the Columns tab, and then select an item in the Auto Merge drop-down list box in the Settings-Current Column group box in the Column and Row Settings dialog box.

Data Type

Integer (Enumerated)

See Also

Merging Cells

Col, RowMerge, Sheet properties

DLL Correspondence

SSGetColMerge, SSSetColMerge functions

Copyright © GrapeCity, inc. All rights reserved.