Syncfusion.Windows.Forms.Grid Namespace : GridGenericControlCellRenderer Class

GridGenericControlCellRenderer Class

Implements the renderer part of a generic control cell.
Object Model
GridGenericControlCellRenderer ClassGridCurrentCell ClassGridStyleInfo ClassGridCellButton ClassIGridDropDownContainer InterfaceIGridDropDownCellImp InterfaceIGridDropDownCellImp InterfaceGridControlBase ClassGridCellModelBase ClassGridStyleInfo Class
Use the GridStyleInfo.Control property to associate any windows forms control with this cell type.

Be careful when sharing this cell type among several cells. In most cases, it will cause problems and you should assign a different control to each cell's GridStyleInfo.Control

GridGenericControlCellRenderer is derived from GridStaticCellRenderer. It adds support for embedding any custom .NET control inside a cell. But if you want to draw the content of the cell yourself, deriving from GridStaticCellRenderers and overriding its OnDraw method should be enough.

See the SliderCells, WebBrowserCells, and PictureBoxCells for samples of this cell type.

The following table lists some characteristics about the Control cell type:

Item Description
CellType Control
Renderer GridGenericControlCellRenderer
Model GridGenericControlCellModel
XP Themes Support NA
Interactive Depends on embedded control
Control System.Windows.Forms.Control
Floating Support No
Base Type GridStaticCellRenderer

The cell's behavior and appearance can be customized with the following properties of the GridStyleInfo class:

PropertyName Description
GridStyleInfo.BaseStyle (System.String) The base style for this style instance with default values for properties that are not initialized for this style object. (Default: String.Empty)
GridStyleInfo.Borders (GridBordersInfo) Top, left, bottom, and right border settings. (Default: GridBordersInfo.Default)
GridStyleInfo.CellAppearance (GridCellAppearance) Specifies if cell edges shall be drawn raised, sunken, or flat (default). (Default: GridCellAppearance.Flat)
GridStyleInfo.CellTipText (System.String) ToolTip text to be displayed when user hovers mouse over cell. (Default: String.Empty)
GridStyleInfo.CellType (System.String) Control (Default: Text Box)
GridStyleInfo.CellValue (System.Object) This property holds the cell value. Although the cell value is typically a string, it can also be any other primitive type such as int, byte, enum, or any custom type that is derived from System.Object. (Default: String.Empty)
GridStyleInfo.CellValueType (System.Type) Specifies the preferred System.Type for cell values. When you assign a value to the GridStyleInfo object, the value will be converted to this type. If the value cannot be converted, GridStyleInfo.Error will contain error information. (Default: NULL)
GridStyleInfo.Control (System.Windows.Forms.Control) A custom control you can associate with a cell. (Default: NULL)
GridStyleInfo.Enabled (System.Boolean) Specifies if the cell can be activated as current cell or if the cell should be skipped when moving the current cell. (Default: True)
GridStyleInfo.Error (System.String) Holds error information if a value could not be converted to the System.Type specified with GridStyleInfo.CellValueType. (Default: String.Empty)
GridStyleInfo.Interior (Syncfusion.Drawing.BrushInfo) Lets you specify a solid backColor, gradient, or pattern style with both back and foreColor for a cells background. (Default: SystemColors.Window)
GridStyleInfo.ReadOnly (System.Boolean) Specifies if cell contents can be modified by the user. You can programmatically change Read-only cells by setting GridModel.DiscardReadOnly to True. (Default: False)

Inheritance Hierarchy

Syncfusion.Grid.Windows: 17.1460.0.47

See Also