StringGrid¶
Qualified name: delphivcl.StringGrid
- class StringGrid¶
Bases:
DrawGridTStringGrid 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
TStringGrid.GetCell(col, row) Returns the content of a cell
TStringGrid.SetCell(col, row, value) Sets the content of a cell
Attributes
ActionSpecifies the action associated with the control.
AlignDetermines how the control aligns within its container (parent control).
AlignDisabledIndicates child control realignment disabled.
AlignWithMarginsSpecifies whether a control should be constrained by margins.
AnchorsSpecifies how the control is anchored to its parent.
BevelEdgesSpecifies which edges of the control are beveled.
BevelInnerSpecifies the cut of the inner bevel.
BevelKindSpecifies the control's bevel style.
BevelOuterSpecifies the cut of the outer bevel.
BevelWidthSpecifies the width of the inner and outer bevels.
BiDiModeSpecifies the bidirectional mode for the control.
BorderStyleDetermines whether a single line border is drawn around the grid.
BoundsRectSpecifies the bounding rectangle of the control, expressed in the coordinate system of the parent control.
BrushDetermines the color and pattern used for painting the background of the control.
Specifies the TCanvas object that presents a drawing surface for the control.
CellAlignmentsAlignment:
str:
ClassNameReturns the TObject.ClassName
ClientHeightSpecifies the height of the control's client area in pixels.
ClientOriginSpecifies the screen coordinates (in pixels) of the upper-left corner of a control's client area.
ClientRectSpecifies the size of a control's client area in pixels.
ClientWidthSpecifies the horizontal size of the control's client area in pixels.
Specifies the index of the column that contains the selected cell.
ColAlignmentsAlignment:
ColCountSpecifies the number of columns in the grid.
Specifies column widths of the grid
ColorSpecifies the background color of the control.
Strings:
ComObjectSpecifies the interface reference implemented by the component.
ComponentCountReturns the owned component count
ComponentIndexIndicates the position of the component in its owner's Components property array.
ComponentStateDescribes the current state of the component, indicating when a component needs to avoid certain actions.
ComponentStyleGoverns the behavior of the component.
ComponentsReturns an iterator over the owned components
ConstraintsSpecifies the size constraints for the control.
ControlCountReturns the count of contained controls
ControlStateSpecifies the current state of a control at run time.
ControlStyleDetermines style characteristics of the control.
ControlsReturns an iterator over contained controls
Ctl3DDetermines whether a control has a three-dimensional (3-D) or two-dimensional look.
CurrentPPIEmbarcadero Technologies does not currently have any additional information.
CursorSpecifies the image used to represent the mouse pointer when it passes into the region covered by the control.
CustomHintCustomHint is a custom hint for the control.
DefaultColAlignmentDefaultColAlignment is the default text alignment for all columns where alignment is not explicitly specified using TCustomGrid.ColAlignments.
DefaultColWidthDetermines the width (in pixels) of all columns that have not been explicitly resized.
DefaultDrawingDetermines whether the Cells are painted when the grid is drawn.
DefaultRowHeightSpecifies the height (in pixels) of all rows that have not been explicitly resized.
DesignInfoContains information used by the Form designer.
DockClientCountSpecifies the number of controls that are docked on the windowed control.
DockClientsControl:
DockManagerSpecifies the control's docking manager interface.
DockOrientationDockOrientation specifies how the control is docked relative to other controls docked in the same parent.
DockSiteSpecifies whether the control can be the target of drag-and-dock operations.
DoubleBufferedDetermines whether the control's image is rendered directly to the window or painted to an in-memory bitmap first.
DoubleBufferedModeDoubleBufferedMode:
DragCursorSpecifies the image used to represent the mouse pointer when the control is being dragged.
DragKindSpecifies whether the control is being dragged normally or for docking.
DragModeSpecifies how the control initiates drag-and-drop or drag-and-dock operations.
DrawingStyleDetermines the style used when drawing the grid.
Determines whether the current cell can be edited.
EnabledControls whether the control responds to mouse, keyboard, and timer events.
ExplicitHeightSpecifies the explicit vertical size of the control in pixels.
ExplicitLeftSpecifies the explicit horizontal pixel coordinate of the left edge of a component relative to its parent.
ExplicitTopSpecifies the explicit vertical pixel coordinate of the top edge of a component relative to its parent.
ExplicitWidthSpecifies the explicit horizontal size of the control in pixels.
FixedColorSpecifies the background color of the fixed rows and columns in the grid.
FixedColsSpecifies the number of columns on the left of the grid that cannot be scrolled.
FixedRowsSpecifies the number of rows on the top of the grid that cannot be scrolled.
FloatingSpecifies whether the control is floating.
FloatingDockSiteClassSpecifies the class of the temporary control that hosts the control when it is floating.
FocusedDetermines whether the control has input focus.
FontSpecifies the attributes of text written on or in the control.
GradientEndColorDetermines the ending gradient color.
GradientStartColorDetermines the starting gradient color.
Specifies the height of the grid in pixels.
GridLineWidthSpecifies the width (in pixels) of the lines that separate the cells of the grid.
Specifies the width of the grid in pixels.
HandleProvides access to the underlying Windows screen object for the control.
HandleAllocatedReports whether a screen object handle exists for the control.
HeightSpecifies the vertical size of the control in pixels.
HelpContextThe HelpContext property contains the numeric context ID that identifies the Help topic for the control.
HelpKeywordThe HelpKeyword property contains the keyword string that identifies the Help topic for the control.
HelpTypeSpecifies whether the control's context-sensitive Help topic is identified by a context ID or by keyword.
HintHint contains the text string that appears when the user moves the mouse over the control.
HostDockSiteSpecifies the control in which the control is docked.
IsDrawingLockedIsDrawingLocked property returns True when redrawing for this control is locked.
IsUpdatingEmbarcadero Technologies does not currently have any additional information.
LRDockWidthSpecifies the width of the control when it is docked horizontally.
LeftSpecifies the horizontal coordinate of the left edge of a component relative to its parent.
Specifies the index of the first visible scrollable column in the grid.
MarginsSpecifies the margins of the control.
MouseInClientIndicates whether the mouse pointer is currently in the client area of the control.
NameSpecifies the name of the component as referenced in code.
Object:
ObserversIndicates the TObservers object added to the TComponent.
OnColumnMovedCallable[[Object, int, int], None]:
OnDragDropCallable[[Object, Object, int, int], None]:
OnDragOverCallable[[Object, Object, int, int, DragState, bool], None]:
OnEndDockCallable[[Object, Object, int, int], None]:
OnEndDragCallable[[Object, Object, int, int], None]:
OnFixedCellClickCallable[[Object, int, int], None]:
OnGestureCallable[[Object, GestureEventInfo, bool], None]:
OnGetEditMaskCallable[[Object, int, int, str], None]:
OnGetEditTextCallable[[Object, int, int, str], None]:
OnMouseActivateCallable[[Object, MouseButton, ShiftState, int, int, int, MouseActivate], None]:
OnMouseWheelDownCallable[[Object, ShiftState, Point, bool], None]:
OnMouseWheelUpCallable[[Object, ShiftState, Point, bool], None]:
OnRowMovedCallable[[Object, int, int], None]:
OnSetEditTextCallable[[Object, int, int, str], None]:
OnStartDockCallable[[Object, DragDockObject], None]:
OnStartDragCallable[[Object, DragObject], None]:
OptionsSpecifies various display and behavioral properties of the grid.
OwnerReturns the Component Owner
PaddingSpecifies the padding of a control.
ParentReturns/Sets the Control Parent
ParentBiDiModeSpecifies whether the control uses its parent's BiDiMode.
ParentColorSpecifies where a control looks for its color information.
ParentCtl3DDetermines where a component looks to determine whether it should have a three-dimensional look.
ParentCustomHintSpecifies where a control looks for its custom hint.
ParentDoubleBufferedParentDoubleBuffered defers the DoubleBuffered property of this component to the value of the parent's DoubleBuffered property.
ParentFontSpecifies where a control looks for its font information.
ParentShowHintSpecifies where a control looks to find out if its Help Hint should be shown.
ParentWindowReference to parent's underlying control.
PixelsPerInchEmbarcadero Technologies does not currently have any additional information.
PopupMenuSpecifies the pop-up menu associated with the control.
RedrawDisabledRedrawDisabled property returns True when redrawing for this control is locked.
Specifies the index of the row that contains the selected cell.
RowCountSpecifies the number of rows in the grid.
Specifies row heights of the grid
Strings:
ScaleFactorEmbarcadero Technologies does not currently have any additional information.
ScrollBarsSpecifies whether the grid includes horizontal and vertical scroll bars.
Indicates the boundaries of the current selection.
ShowHintShowHint specifies whether to show the Help Hint when the mouse pointer moves over the control.
ShowingIndicates whether the control is showing on the screen.
StyleElementsSpecifies the style elements that are used by the control.
StyleNameEmbarcadero Technologies does not currently have any additional information.
TBDockHeightSpecifies the height of the control when it is docked vertically.
TabOrderIndicates the position of the control in its parent's tab order.
TabStopDetermines whether the user can tab to a control.
TabStopsbool:
TagStores a NativeInt integral value as a part of a component.
TopSpecifies the Y coordinate of the upper-left corner of a control, relative to its parent or containing control in pixels.
Specifies the index of the first visible scrollable row in the grid.
TouchSpecifies the touch manager component associated with the control.
UndockHeightSpecifies the height of the control when it is floating.
UndockWidthSpecifies the width of the control when it is floating.
UseDockManagerSpecifies whether the docking manager is used in drag-and-dock operations.
VCLComObjectRepresents information used internally by components that support COM.
VisibleSpecifies whether the component appears onscreen.
VisibleColCountIndicates the number of scrollable columns visible in the grid.
VisibleDockClientCountSpecifies the number of visible controls that are docked on the windowed control.
VisibleRowCountIndicates the number of scrollable rows visible in the grid.
WidthSpecifies the horizontal size of the control or form in pixels.
- Canvas¶
Specifies the TCanvas object that presents a drawing surface for the control.
- Cells¶
str:
- Col¶
Specifies the index of the column that contains the selected cell.
- ColWidths¶
Specifies column widths of the grid
- Cols¶
Strings:
- 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¶
Object:
- Row¶
Specifies the index of the row that contains the selected cell.
- RowHeights¶
Specifies row heights of the grid
- Rows¶
Strings:
- 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.