BCGControlBar Library for .NET
Cell Class
Members 




This class is used to display GridDataItem objects on the screen and enables editing of data encapsulated in GridDataItem.

The collection of cells is rebuild every time the layout of Grid has changed and is limited to items located in the visible Grid control area, therefore you should not store references to cell objects or make any assumptions about their life time.

While a particular GridDataItem can be edited from different grid controls, a Cell object that encapsulates the item belongs to the current Grid control and defines the item's visual style, bounding rectangle, highlight state, selection state - everything to make the item appear on the screen.

If you wish to represent a custom data in the grid:

  1. Derive a class from the Cell class, or one of other predefined cell classes (like TextCell if you need an editable cell).
  2. Set GridDataItem.DataType property to GridDataType.Custom.
  3. Subscribe to CreateCustomCell event.
  4. Instantiate the custom cell object in the event handler and return it back to Grid control.
  5. Override DrawContent to render the data on the screen.
  6. Override CreateEditControl if you inherited your cell class from TextCell and return a reference to edit control.
  7. Override GetEditData to return modified data when the Grid requests it.

You can study GridControlDemo example (see Custom Cells page) to learn how to create custom cells in details.

Object Model
Cell ClassGridColumn ClassGridDataItem ClassGridDataRow ClassGridCellVisualStyle Class
Syntax
'Declaration
 
Public Class Cell 
'Usage
 
Dim instance As Cell
public class Cell 
public __gc class Cell 
public ref class Cell 
Inheritance Hierarchy

System.Object
   BCGSoft.Controls.Grid.Cell
      BCGSoft.Controls.Grid.CheckBoxCell
      BCGSoft.Controls.Grid.ImageCell
      BCGSoft.Controls.Grid.ImageListCell
      BCGSoft.Controls.Grid.TextCell

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

Cell Members
BCGSoft.Controls.Grid Namespace

Send Feedback