Click or drag to resize
CellControl Class
Class used by GridControl to interact with .NET cell controls.
Inheritance Hierarchy
SystemObject
  Stingray.GridCellControl

Namespace: Stingray.Grid
Assembly: Stingray.GridControl (in Stingray.GridControl.dll) Version: 14.0.0.0
Syntax
public class CellControl

The CellControl type exposes the following members.

Methods
  NameDescription
Protected methodOnCanceledEditing
Raises the CanceledEditing event.
Protected methodOnCancelEditing
Raises the CancelEditing event.
Protected methodOnDraw
Raises the DrawCellControl event.
Protected methodOnEndEditing
Raises the EndEditing event.
Protected methodOnHide
Raises the HideCurrentCell event.
Protected methodOnInit
Raises the InitCurrentCell event.
Protected methodOnLeftCell
Raises the LeftCell event.
Protected methodOnModifyCell
Raises the ModifyCell event.
Protected methodOnRefresh
Raises the RefreshCurrentCell event
Protected methodOnReset
Raises the ResetCurrentCell event.
Protected methodOnStartEditing
Raises the StartEditing event.
Protected methodOnStore
Raises the StoreCurrentCell event.
Protected methodOnValidate
Raises the ValidateCell event.
Top
Properties
  NameDescription
Public propertyDrawInactiveCell
Gets or sets a value indicating if you want the grid to draw inactive cell contents.
Public propertyGrid
Gets the GridControl with which this custom control is associated.
Public propertyProcessEnterKey
Gets or sets a value indicating if your custom control processes enter key events.
Public propertyProcessHorizontalArrows
Gets or sets a value indicating if your custom control processes horizontal arrow key events.
Public propertyProcessVerticalArrows
Gets or sets a value indicating if your custom control processes vertical arrow key events.
Public propertyUseCellStyle
Gets or sets a value that indicates whether the cell style from the grid should be applied to the custom control.
Top
Events
  NameDescription
Public eventCanceledEditing
Canceled Editing event.
Public eventCancelEditing
Cancel Editing event.
Public eventDrawCellControl
Draw Cell Control event.
Public eventEndEditing
End Editing event.
Public eventHideCurrentCell
Hide Current Cell event.
Public eventInitCurrentCell
Initialize Current Cell event.
Public eventLeftCell
Left Cell event.
Public eventModifyCell
Modify Cell event.
Public eventRefreshCurrentCell
Refresh Current Cell event.
Public eventResetCurrentCell
Reset Current Cell event.
Public eventStartEditing
Start Editing event.
Public eventStoreCurrentCell
Store Current Cell event.
Public eventValidateCell
Validate Cell event.
Top
Remarks
This class embeds .NET controls in grid cells. Instances of this class can be obtained only via the RegisterControl(Control) method.

You can configure instances of this class using the properties associated with the class. You can monitor or customize the behavior of the controls when grid events occur by attaching delegates to the many events exposed by the class.

After you configure the CellControl instance, it can be used in grid cells by creating or obtaining a style object, setting the CustomControl property to the desired CellControl, and then applying the style to the grid.

Note Note
Stingray Grid .NET currently supports the registration of up to 32 .NET cell controls.

When a .NET control is used as a grid cell editor, only one instance of the control is held, even when the control is used with a range of cells. When a grid cell that contains the custom control becomes the current cell, the control is initialized with the cell contents for the current cell and is made visible in the current cell.

By default, the stored grid value (Value) is used to initialize the control Text property upon initialization. For more advanced behavior, attach delegates to the InitCurrentCell and StoreCurrentCell events.

Some .NET controls, such as NumericUpDown controls and single-line edit controls, do not size themselves exactly as instructed. In these cases, the .NET cell controls may not completely fill a grid cell. These controls may also consume a larger screen area than the size of the cell in which they are embedded.

Currently, delegates must be used to customize the behavior of .NET controls. Derivation from CellControl is not currently supported.

See Also