Click or drag to resize
Cell Class
Represents a cell in the grid.
Inheritance Hierarchy

Namespace: Stingray.Grid
Assembly: Stingray.GridControl (in Stingray.GridControl.dll) Version: [TAG_DECIMAL_VERSION]
public class Cell : IDisposable

The Cell type exposes the following members.

Public methodApplyNewStyle
Applies a new style stored in this cell object.
Public methodClearStyle
Clears the embedded Style object.
Public methodClearValue
Clears the value of the cell.
Public methodCopyCell
Copies the contents of another cell into this cell.
Public methodCopyCells
Copies a range of cells.
Public methodCopyStyle
Copies the new style over the style stored in this cell object.
Public methodExcludeStyle
Remove, in this cell's style, the attributes that are included in the given style.
Public methodMoveCell
Moves a cell.
Public methodMoveCells
Moves cells.
Public methodScrollInView
Scrolls the grid so that this cell is in view.
Public methodScrollInView(RedrawFlags, Boolean)
Scrolls the grid so that this cell is in view.
Public methodSelect(Boolean)
Selects or deselects this cell.
Public methodSelect(Boolean, Boolean)
Selects or deselects this cell.
Public propertyCol
Gets the managed grid's column index.
Public propertyControlText
Gets the control text displayed in the cell.
Public propertyDirty
Gets or sets the state of the cell contents
Public propertyFormula
Gets or sets the text value or formula for the cell.
Public propertyIsCurrent
Gets or sets whether the cell is selected or is the specified cell.
Public propertyRow
Gets the managed grid's row index.
Public propertyStyle
Gets or sets the Style for this cell.
Instances of this class are available via the GridControl indexer. For example, the following C# source code obtains a Cell object referencing cell [1, 1] by using the indexer on a GridControl named myGridControl.
Cell cell = myGridControl[1, 1];
Once an instance of a cell is obtained, you can use it to manipulate the style for the cell that it references, or you can store it as a reference to a location in the grid.

Because the GridControl indexer property returns an instance of a Cell object and the Cell class offers a Style property, cell styles can be conveniently manipulated in source code using single lines of code.d For example, the following C# source code changes the Interior property of a grid cell to a hatched pattern with black as the foreground color and bisque as the background color.

myGridControl[1, 1].Style.Interior = Stingray.Grid.OGBrush.OGHatchedBrush(Color.Black, Color.Bisque, HatchStyle.Cross);
The following C# source code changes the style of cell [1, 2] to read-only with the text "Read Only".
myGridControl[1, 2].Style.Value = "Read Only";
myGridControl[1, 2].Style.ReadOnly = true;

See Also