Class GridModelMergeCells
Implements the functionalities to manage merged cell ranges for a grid.
Implements
Inherited Members
Namespace: Syncfusion.Windows.Forms.Grid
Assembly: Syncfusion.Grid.Windows.dll
Syntax
public class GridModelMergeCells : GridModelBound, IDisposable, ISerializable
Remarks
You access this class from a grid with the MergeCells property of a GridModel instance.
Merged ranges are saved in two separate collections:
The first collection is GridRangeInfoList which allows quick enumeration through all merged cell ranges in the grid. This is good when merged ranges need to be recalculated because rows or column have been inserted, moved, or removed.
The second collection is Syncfusion.Windows.Forms.Grid.GridSpanCellPool that is optimized to look up if a specific cell is part of a merged range.
Constructors
GridModelMergeCells(GridModel)
Initializes a new instance of GridModelMergeCells class and associates it with a GridModel.
Declaration
public GridModelMergeCells(GridModel model)
Parameters
Type | Name | Description |
---|---|---|
GridModel | model | A reference to the parent GridModel. |
GridModelMergeCells(SerializationInfo, StreamingContext)
Initializes a new instance of GridModelMergeCells from a serialization stream.
Declaration
protected GridModelMergeCells(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Runtime.Serialization.SerializationInfo | info | An object that holds all the data needed to serialize or de-serialize this instance. |
System.Runtime.Serialization.StreamingContext | context | Describes the source and destination of the serialized stream specified by info. |
Methods
DelayMergeCells(GridRangeInfo)
Marks the specified range of cells to be re-evaluated at a later time.
Declaration
public void DelayMergeCells(GridRangeInfo range)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInfo | range | The range to be re-evaluated. |
EvaluateMergeCells(GridRangeInfo)
Checks the specified range if any cells have been previously marked with DelayMergeCells(GridRangeInfo) to be re-evaluated.
Declaration
public bool EvaluateMergeCells(GridRangeInfo range)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInfo | range | The range to be re-evaluated. |
Returns
Type | Description |
---|---|
System.Boolean | True if merge state for any cell in the given range was changed. |
Find(GridMergeCellDirection, Int32, Int32, out GridRangeInfo)
Returns a GridRangeInfo object that indicates the merge cell's range for the specified cell position or False if there are no merge cells in range for the given cell position.
Declaration
public bool Find(GridMergeCellDirection mergeDirection, int rowIndex, int colIndex, out GridRangeInfo range)
Parameters
Type | Name | Description |
---|---|---|
GridMergeCellDirection | mergeDirection | Specifies whether cells merged in row or column (or both) are asked for. |
System.Int32 | rowIndex | The row index. |
System.Int32 | colIndex | The column index. |
GridRangeInfo | range | The GridRangeInfo where the found merge cell's range is returned. |
Returns
Type | Description |
---|---|
System.Boolean | True if a merge cell's range is at the specified cell position; False if not. |
FindRange(Int32, Int32)
Returns a GridRangeInfo object that indicates the merge cell's range for the specified cell position or Empty if there are no merge cells in range for the given cell position.
Declaration
public GridRangeInfo FindRange(int rowIndex, int colIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowIndex | The row index. |
System.Int32 | colIndex | The column index. |
Returns
Type | Description |
---|---|
GridRangeInfo | A reference to range if a merge cell's range is at the specified cell position or Empty if not. |
Merge(GridRangeInfo)
Combines all merge cells' ranges that intersect into one outer range that spans over all found ranges.
Declaration
public GridRangeInfo Merge(GridRangeInfo range)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInfo | range | The original range. |
Returns
Type | Description |
---|---|
GridRangeInfo | The GridRangeInfo with the outer range. |
Explicit Interface Implementations
ISerializable.GetObjectData(SerializationInfo, StreamingContext)
Implements the ISerializable interface and returns the data needed to serialize the GridModelMergeCells.
Declaration
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Runtime.Serialization.SerializationInfo | info | A SerializationInfo object containing the information required to serialize the object. |
System.Runtime.Serialization.StreamingContext | context | A StreamingContext object containing the source and destination of the serialized stream. |