StringGrid#

Qualified name: delphivcl.StringGrid

class StringGrid#

Bases: DrawGrid

TStringGrid represents a grid control designed to simplify the handling of strings and associated objects. Add a TStringGrid object to a form to present textual data in a tabular format. TStringGrid provides many properties to control the appearance of the grid, as well as events and methods that take advantage of the tabular organization of the grid in responding to user actions. TStringGrid introduces the ability to associate an object with each string in the grid. These objects can encapsulate any information or behavior represented by the strings that are presented to the user. For a TStringGrid, the DrawingStyle property controls whether the current settings have any effect for FixedColor, and for GradientStartColor and GradientEndColor:

Setting FixedColor has no effect unless you also set DrawingStyle to gdsClassic. Setting GradientStartColor and GradientEndColor has no effect unless you set the value of DrawingStyle to gdsGradient. Note: If the strings to be presented in a grid represent field values from the records in a dataset, use TDBGrid instead. Note: To display the string and the associated object or control, use TDrawGrid instead. .

Methods

Create

Creates an instance of TStringGrid.

Destroy

Destroys an instance of TStringGrid.

GetCell

Returns the content of a cell

SetCell

Sets the content of a cell

Attributes

Action

Specifies the action associated with the control.

Align

Determines how the control aligns within its container (parent control).

AlignDisabled

Indicates child control realignment disabled.

AlignWithMargins

Specifies whether a control should be constrained by margins.

Anchors

Specifies how the control is anchored to its parent.

BevelEdges

Specifies which edges of the control are beveled.

BevelInner

Specifies the cut of the inner bevel.

BevelKind

Specifies the control's bevel style.

BevelOuter

Specifies the cut of the outer bevel.

BevelWidth

Specifies the width of the inner and outer bevels.

BiDiMode

Specifies the bidirectional mode for the control.

BorderStyle

Determines whether a single line border is drawn around the grid.

BoundsRect

Specifies the bounding rectangle of the control, expressed in the coordinate system of the parent control.

Brush

Determines the color and pattern used for painting the background of the control.

Canvas

Specifies the TCanvas object that presents a drawing surface for the control.

CellAlignments

<Delphi indexed property CellAlignments of type TCustomDrawGrid at 21141266E70>

Cells

<Delphi indexed property Cells of type TStringGrid at 21141267170>

ClassName

Returns the TObject.ClassName

ClientHeight

Specifies the height of the control's client area in pixels.

ClientOrigin

Specifies the screen coordinates (in pixels) of the upper-left corner of a control's client area.

ClientRect

Specifies the size of a control's client area in pixels.

ClientWidth

Specifies the horizontal size of the control's client area in pixels.

Col

Specifies the index of the column that contains the selected cell.

ColAlignments

<Delphi indexed property ColAlignments of type TCustomDrawGrid at 21141266DB0>

ColCount

Specifies the number of columns in the grid.

ColWidths

Specifies column widths of the grid

Color

Specifies the background color of the control.

Cols

<Delphi indexed property Cols of type TStringGrid at 21141267230>

ComObject

Specifies the interface reference implemented by the component.

ComponentCount

Indicates the number of components owned by the component.

ComponentIndex

Indicates the position of the component in its owner's Components property array.

ComponentState

Describes the current state of the component, indicating when a component needs to avoid certain actions.

ComponentStyle

Governs the behavior of the component.

Components

<Delphi indexed property Components of type TComponent at 21141642500>

Constraints

Specifies the size constraints for the control.

ControlCount

Returns the count of contained controls

ControlState

Specifies the current state of a control at run time.

ControlStyle

Determines style characteristics of the control.

Controls

Returns an iterator over contained controls

Ctl3D

Determines whether a control has a three-dimensional (3-D) or two-dimensional look.

CurrentPPI

Embarcadero Technologies does not currently have any additional information.

Cursor

Specifies the image used to represent the mouse pointer when it passes into the region covered by the control.

CustomHint

CustomHint is a custom hint for the control.

DefaultColAlignment

DefaultColAlignment is the default text alignment for all columns where alignment is not explicitly specified using TCustomGrid.ColAlignments.

DefaultColWidth

Determines the width (in pixels) of all columns that have not been explicitly resized.

DefaultDrawing

Determines whether the Cells are painted when the grid is drawn.

DefaultRowHeight

Specifies the height (in pixels) of all rows that have not been explicitly resized.

DesignInfo

Contains information used by the Form designer.

DockClientCount

Specifies the number of controls that are docked on the windowed control.

DockClients

<Delphi indexed property DockClients of type TWinControl at 211416EE520>

DockManager

Specifies the control's docking manager interface.

DockOrientation

DockOrientation specifies how the control is docked relative to other controls docked in the same parent.

DockSite

Specifies whether the control can be the target of drag-and-dock operations.

DoubleBuffered

Determines whether the control's image is rendered directly to the window or painted to an in-memory bitmap first.

DragCursor

Specifies the image used to represent the mouse pointer when the control is being dragged.

DragKind

Specifies whether the control is being dragged normally or for docking.

DragMode

Specifies how the control initiates drag-and-drop or drag-and-dock operations.

DrawingStyle

Determines the style used when drawing the grid.

EditorMode

Determines whether the current cell can be edited.

Enabled

Controls whether the control responds to mouse, keyboard, and timer events.

ExplicitHeight

Specifies the explicit vertical size of the control in pixels.

ExplicitLeft

Specifies the explicit horizontal pixel coordinate of the left edge of a component relative to its parent.

ExplicitTop

Specifies the explicit vertical pixel coordinate of the top edge of a component relative to its parent.

ExplicitWidth

Specifies the explicit horizontal size of the control in pixels.

FixedColor

Specifies the background color of the fixed rows and columns in the grid.

FixedCols

Specifies the number of columns on the left of the grid that cannot be scrolled.

FixedRows

Specifies the number of rows on the top of the grid that cannot be scrolled.

Floating

Specifies whether the control is floating.

FloatingDockSiteClass

Specifies the class of the temporary control that hosts the control when it is floating.

Focused

Determines whether the control has input focus.

Font

Specifies the attributes of text written on or in the control.

GradientEndColor

Determines the ending gradient color.

GradientStartColor

Determines the starting gradient color.

GridHeight

Specifies the height of the grid in pixels.

GridLineWidth

Specifies the width (in pixels) of the lines that separate the cells of the grid.

GridWidth

Specifies the width of the grid in pixels.

Handle

Provides access to the underlying Windows screen object for the control.

HandleAllocated

Reports whether a screen object handle exists for the control.

Height

Specifies the vertical size of the control in pixels.

HelpContext

The HelpContext property contains the numeric context ID that identifies the Help topic for the control.

HelpKeyword

The HelpKeyword property contains the keyword string that identifies the Help topic for the control.

HelpType

Specifies whether the control's context-sensitive Help topic is identified by a context ID or by keyword.

Hint

Hint contains the text string that appears when the user moves the mouse over the control.

HostDockSite

Specifies the control in which the control is docked.

IsDrawingLocked

IsDrawingLocked property returns True when redrawing for this control is locked.

IsUpdating

Embarcadero Technologies does not currently have any additional information.

LRDockWidth

Specifies the width of the control when it is docked horizontally.

Left

Specifies the horizontal coordinate of the left edge of a component relative to its parent.

LeftCol

Specifies the index of the first visible scrollable column in the grid.

Margins

Specifies the margins of the control.

MouseInClient

Indicates whether the mouse pointer is currently in the client area of the control.

Name

Specifies the name of the component as referenced in code.

Objects

<Delphi indexed property Objects of type TStringGrid at 211412672F0>

Observers

Indicates the TObservers object added to the TComponent.

OnClick

<Delphi property OnClick of type TDrawGrid at 21141CAC8A0>

OnColumnMoved

<Delphi property OnColumnMoved of type TDrawGrid at 21141CAC970>

OnContextPopup

<Delphi property OnContextPopup of type TDrawGrid at 21141CACA40>

OnDblClick

<Delphi property OnDblClick of type TDrawGrid at 21141CACB10>

OnDragDrop

<Delphi property OnDragDrop of type TDrawGrid at 21141CACBE0>

OnDragOver

<Delphi property OnDragOver of type TDrawGrid at 21141CACCB0>

OnDrawCell

<Delphi property OnDrawCell of type TDrawGrid at 21141CACD80>

OnEndDock

<Delphi property OnEndDock of type TDrawGrid at 21141CACE50>

OnEndDrag

<Delphi property OnEndDrag of type TDrawGrid at 21141CACF20>

OnEnter

<Delphi property OnEnter of type TDrawGrid at 21141CACFF0>

OnExit

<Delphi property OnExit of type TDrawGrid at 21141CAD0C0>

OnFixedCellClick

<Delphi property OnFixedCellClick of type TDrawGrid at 21141CAD190>

OnGesture

<Delphi property OnGesture of type TDrawGrid at 21141CAD260>

OnGetEditMask

<Delphi property OnGetEditMask of type TDrawGrid at 21141CAD330>

OnGetEditText

<Delphi property OnGetEditText of type TDrawGrid at 21141CAD400>

OnKeyDown

<Delphi property OnKeyDown of type TDrawGrid at 21141CAD4D0>

OnKeyPress

<Delphi property OnKeyPress of type TDrawGrid at 21141CAD5A0>

OnKeyUp

<Delphi property OnKeyUp of type TDrawGrid at 21141CAD670>

OnMouseActivate

<Delphi property OnMouseActivate of type TDrawGrid at 21141CAD740>

OnMouseDown

<Delphi property OnMouseDown of type TDrawGrid at 21141CAD810>

OnMouseEnter

<Delphi property OnMouseEnter of type TDrawGrid at 21141CAD8E0>

OnMouseLeave

<Delphi property OnMouseLeave of type TDrawGrid at 21141CAD9B0>

OnMouseMove

<Delphi property OnMouseMove of type TDrawGrid at 21141CADA80>

OnMouseUp

<Delphi property OnMouseUp of type TDrawGrid at 21141CADB50>

OnMouseWheelDown

<Delphi property OnMouseWheelDown of type TDrawGrid at 21141CADC20>

OnMouseWheelUp

<Delphi property OnMouseWheelUp of type TDrawGrid at 21141CADCF0>

OnRowMoved

<Delphi property OnRowMoved of type TDrawGrid at 21141CADDC0>

OnSelectCell

<Delphi property OnSelectCell of type TDrawGrid at 21141CADE90>

OnSetEditText

<Delphi property OnSetEditText of type TDrawGrid at 21141CADF60>

OnStartDock

<Delphi property OnStartDock of type TDrawGrid at 21141CAE030>

OnStartDrag

<Delphi property OnStartDrag of type TDrawGrid at 21141CAE100>

OnTopLeftChanged

<Delphi property OnTopLeftChanged of type TDrawGrid at 21141CAE1D0>

Options

Specifies various display and behavioral properties of the grid.

Owner

Indicates the component that is responsible for streaming and freeing this component.

Padding

Specifies the padding of a control.

Parent

Returns/Sets the Control Parent

ParentBiDiMode

Specifies whether the control uses its parent's BiDiMode.

ParentColor

Specifies where a control looks for its color information.

ParentCtl3D

Determines where a component looks to determine whether it should have a three-dimensional look.

ParentCustomHint

Specifies where a control looks for its custom hint.

ParentDoubleBuffered

ParentDoubleBuffered defers the DoubleBuffered property of this component to the value of the parent's DoubleBuffered property.

ParentFont

Specifies where a control looks for its font information.

ParentShowHint

Specifies where a control looks to find out if its Help Hint should be shown.

ParentWindow

Reference to parent's underlying control.

PixelsPerInch

Embarcadero Technologies does not currently have any additional information.

PopupMenu

Specifies the pop-up menu associated with the control.

RedrawDisabled

RedrawDisabled property returns True when redrawing for this control is locked.

Row

Specifies the index of the row that contains the selected cell.

RowCount

Specifies the number of rows in the grid.

RowHeights

Specifies row heights of the grid

Rows

<Delphi indexed property Rows of type TStringGrid at 211412673B0>

ScaleFactor

Embarcadero Technologies does not currently have any additional information.

ScrollBars

Specifies whether the grid includes horizontal and vertical scroll bars.

Selection

Indicates the boundaries of the current selection.

ShowHint

ShowHint specifies whether to show the Help Hint when the mouse pointer moves over the control.

Showing

Indicates whether the control is showing on the screen.

StyleElements

Specifies the style elements that are used by the control.

StyleName

Embarcadero Technologies does not currently have any additional information.

TBDockHeight

Specifies the height of the control when it is docked vertically.

TabOrder

Indicates the position of the control in its parent's tab order.

TabStop

Determines whether the user can tab to a control.

TabStops

<Delphi indexed property TabStops of type TCustomDrawGrid at 21141266FF0>

Tag

Stores a NativeInt integral value as a part of a component.

Top

Specifies the Y coordinate of the upper-left corner of a control, relative to its parent or containing control in pixels.

TopRow

Specifies the index of the first visible scrollable row in the grid.

Touch

Specifies the touch manager component associated with the control.

UndockHeight

Specifies the height of the control when it is floating.

UndockWidth

Specifies the width of the control when it is floating.

UseDockManager

Specifies whether the docking manager is used in drag-and-dock operations.

VCLComObject

Represents information used internally by components that support COM.

Visible

Specifies whether the component appears onscreen.

VisibleColCount

Indicates the number of scrollable columns visible in the grid.

VisibleDockClientCount

Specifies the number of visible controls that are docked on the windowed control.

VisibleRowCount

Indicates the number of scrollable rows visible in the grid.

Width

Specifies the horizontal size of the control or form in pixels.

WindowProc

<Delphi property WindowProc of type TControl at 211418EC1C0>

Canvas#

Specifies the TCanvas object that presents a drawing surface for the control.

Cells#

<Delphi indexed property Cells of type TStringGrid at 21141267170>

Col#

Specifies the index of the column that contains the selected cell.

ColWidths#

Specifies column widths of the grid

Cols#

<Delphi indexed property Cols of type TStringGrid at 21141267230>

Create(AOwner: Component)#

Creates an instance of TStringGrid. Call Create to create an instance of TStringGrid at runtime. For string grids placed on forms at design time, Create is called automatically. AOwner is another component, typically a form, that becomes the grid’s Owner. The Owner is responsible for freeing the grid.

Destroy()#

Destroys an instance of TStringGrid. Do not call Destroy directly in an application. Instead, call Free. Free verifies that the string grid is not nil, and only then calls Destroy. Destroy frees the helper objects used to manage the array of strings and their associated objects.

EditorMode#

Determines whether the current cell can be edited.

GetCell(col, row)#

Returns the content of a cell

GridHeight#

Specifies the height of the grid in pixels.

GridWidth#

Specifies the width of the grid in pixels.

LeftCol#

Specifies the index of the first visible scrollable column in the grid.

Objects#

<Delphi indexed property Objects of type TStringGrid at 211412672F0>

Row#

Specifies the index of the row that contains the selected cell.

RowHeights#

Specifies row heights of the grid

Rows#

<Delphi indexed property Rows of type TStringGrid at 211412673B0>

Selection#

Indicates the boundaries of the current selection.

SetCell(col, row, value)#

Sets the content of a cell

TopRow#

Specifies the index of the first visible scrollable row in the grid.