Objective Grid for Microsoft® .NET® Reference Guide

CellControl Class

Back to Class Index

This class is used by GridControl to interact with .NET cell controls.     

For a list of all members of this type, see CellControl Members.

System.Object
   CellControl

[Visual Basic]
Public Class CellControl
[C#]
public class CellControl

Remarks

    

This class embeds .NET controls in grid cells. Instances of this class can be obtained only via the GridControl.RegisterControl 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 Style.CustomControl property to the desired CellControl, and then applying the style to the grid.     

    

Several StingrayGrid .NET samples illustrate the use of .NET cell controls.     

    

Note: StingrayGrid .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 (Style.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.     

    

Requirements

Namespace: Stingray.Grid

Assemblies: Stingray.GridControl80 (in Stingray.GridControl80.dll)
                     Stingray.GridControl90 (in Stingray.GridControl90.dll)
                     Stingray.GridControl10 (in Stingray.GridControl10.dll)

See Also

CellControl Members | Stingray.Grid Namespace