FlexGrid for WinForms
Merging Cells

The C1FlexGrid control allows you to merge cells, making them span multiple rows or columns. This capability can be used to enhance the appearance and clarity of the data displayed on the grid. The effect of these settings is similar to the HTML <ROWSPAN> and <COLSPAN> tags.

To enable cell merging, you must do two things:

  1. Set the grid's AllowMerging property to a value other than None. (The effect of each setting is explained in the reference section.)
  2. If you want to merge columns, set the AllowMerging property to True for each column that you would like to merge. If you want to merge rows, set the AllowMerging property to True for each row that you would like to merge

Merging will occur if adjacent cells contain the same non-empty string. There is no method to force a pair of cells to merge. The merging is done automatically based on the cell contents. This makes it easy to provide merged views of sorted data, where values in adjacent rows present repeated data.

Cell merging has several possible uses. For example, you can use it to create merged table headers, merged data views, or grids where the text spills into adjacent columns.

See Also

 

 


Copyright © GrapeCity, inc. All rights reserved.

Product Support Forum |  Documentation Feedback