Click or drag to resize
GridControlRegisterControl Method (Control)
Registers a .NET control for use as a Stingray Grid .NET cell editor.

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

Parameters

control
Type: System.Windows.FormsControl
The control to register.

Return Value

Type: CellControl
The CellControl that is build to encapsulate control.
Remarks
Use this method to register any .NET control for use as a grid cell editor. The CellControl instance returned from this method can then be used with the CustomControl property to use the control in a cell or a range of cells.

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 is made 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's Text property upon initialization. For more advanced behavior, attach delegates to the InitCurrentCell event of the CellControl.

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 supported.

See Also