Class GridStaticCellModel
Defines the data / model part of a static cell. A static cell is also a base class for many other cell types that display text.
Inheritance
Implements
Inherited Members
Namespace: Syncfusion.Windows.Forms.Grid
Assembly: Syncfusion.Grid.Windows.dll
Syntax
public class GridStaticCellModel : GridCellModelBase, ISerializable, IDisposable
Remarks
You typically access cell models through the CellModels property of the GridModel class.
A GridStaticCellModel can serve as model for several GridStaticCellRenderer instances if a there are several GridControlBase views for a GridModel.
See GridStaticCellRenderer for more detailed information about this cell type.
Constructors
GridStaticCellModel(GridModel)
Initializes a new GridStaticCellModel object and stores a reference to the GridModel this cell belongs to.
Declaration
public GridStaticCellModel(GridModel grid)
Parameters
| Type | Name | Description |
|---|---|---|
| GridModel | grid | The GridModel for this cell model. |
Remarks
You typically access cell models through the CellModels property of the GridModel class.
GridStaticCellModel(SerializationInfo, StreamingContext)
Initializes a new GridStaticCellModel from a serialization stream.
Declaration
protected GridStaticCellModel(SerializationInfo info, StreamingContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Runtime.Serialization.SerializationInfo | info | An object that holds all the data needed to serialize or deserialize this instance. |
| System.Runtime.Serialization.StreamingContext | context | Describes the source and destination of the serialized stream specified by info. |
Properties
AllowFloating
Gets or sets a value indicating whether this cell type supports being floated or flooded.
Declaration
public bool AllowFloating { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
AllowMerging
Gets or sets a value indicating whether this cell type supports being merged.
Declaration
public bool AllowMerging { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
Methods
CreateRenderer(GridControlBase)
Creates a renderer for this cell model.
Declaration
public override GridCellRendererBase CreateRenderer(GridControlBase control)
Parameters
| Type | Name | Description |
|---|---|---|
| GridControlBase | control | The grid control. |
Returns
| Type | Description |
|---|---|
| GridCellRendererBase | Cell renderer. |
Overrides
GetObjectData(SerializationInfo, StreamingContext)
Implements the ISerializable interface and returns the data needed to serialize the cell model.
Declaration
public override void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Runtime.Serialization.SerializationInfo | info | A SerializationInfo object containing the information required to serialize the cell model. |
| System.Runtime.Serialization.StreamingContext | context | A StreamingContext object containing the source and destination of the serialized stream. |
Overrides
OnQueryCanFloatCell(Int32, Int32, GridStyleInfo, GridQueryFloatCell)
Determines whether the cell supports floating over a neighboring cell or can be flooded by a previous cell.
Declaration
public override bool OnQueryCanFloatCell(int rowIndex, int colIndex, GridStyleInfo style, GridQueryFloatCell query)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | rowIndex | The row index. |
| System.Int32 | colIndex | The column index. |
| GridStyleInfo | style | The GridStyleInfo object that holds cell information. |
| GridQueryFloatCell | query | A GridQueryFloatCell value that specifies whether a cell is asked about support for floating over another cell or being flooded by a previous cell. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if floating is possible; False otherwise. |
Overrides
OnQueryCanMergeCell(Int32, Int32, GridStyleInfo, GridMergeCellDirection)
Determines whether the cell supports merging of neighboring cells.
Declaration
public override bool OnQueryCanMergeCell(int rowIndex, int colIndex, GridStyleInfo style, GridMergeCellDirection mergeCellDirection)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | rowIndex | The row index. |
| System.Int32 | colIndex | The column index. |
| GridStyleInfo | style | The GridStyleInfo object that holds cell information. |
| GridMergeCellDirection | mergeCellDirection | Specifies if rows or columns should be merged. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if merging is possible; False otherwise. |
Overrides
OnQueryPrefferedClientSize(Graphics, Int32, Int32, GridStyleInfo, GridQueryBounds)
Calculates the preferred size of the cell based on its contents without margins and any buttons.
Declaration
protected override Size OnQueryPrefferedClientSize(Graphics g, int rowIndex, int colIndex, GridStyleInfo style, GridQueryBounds queryBounds)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Graphics | g | The System.Drawing.Graphics context of the canvas. |
| System.Int32 | rowIndex | The row index. |
| System.Int32 | colIndex | The column index. |
| GridStyleInfo | style | The GridStyleInfo object that holds cell information. |
| GridQueryBounds | queryBounds | Graphical bounds |
Returns
| Type | Description |
|---|---|
| System.Drawing.Size | The optimal size of the cell. |