Unit 'Grids' Package
[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] [#lcl]

TCustomStringGrid

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

The base class for TStringGrid.

Declaration

Source position: grids.pas line 1721

type TCustomStringGrid = class(TCustomDrawGrid)

protected

  procedure AssignTo(); override;

  

Assigns values from the current class instance to the target class instance.

  procedure AutoAdjustColumn(); override;

  

Adjusts the column size for the font, text and images used in the specified column.

  procedure CalcCellExtent(); override;

  

Deprecated in the ancestor class.

  procedure DefineProperties(); override;

  

Defines non-published properties included in LCL component streaming.

  procedure DefineCellsProperty(); virtual;

  

Defines the reader and writer for the Cells property in a TFiler instance.

  function DoCompareCells(); override;

  

Performs a comparison between the specified cells in the grid control.

  procedure DoCopyToClipboard; override;

  

Copies the selected data to the clipboard.

  procedure DoCutToClipboard; override;

  

Cuts the data from its current site and places it in the clipboard.

  procedure DoPasteFromClipboard; override;

  

Pastes data from the clipboard into the current cell.

  procedure DoCellProcess(); virtual;

  

Performs actions needed when cell values are copied or pasted using the clipboard.

  procedure DrawColumnText(); override;

  

Draws the text and image for a grid column title at the specified cell coordinates.

  procedure DrawTextInCell(); override;

  

Draws the text for the specified cell in a given drawing state.

  procedure DrawCellAutonumbering(); override;

  

Performs auto-numbering for a cell in the grid.

  function GetCells(); override;

  

Gets the value for the indexed Cells property.

  procedure GetCheckBoxState(); override;

  

Gets the state for a cell displayed as a Checkbox.

  function GetEditText(); override;

  

Gets the text displayed in the Editor for the specified cell.

  procedure LoadContent(); override;

  

Loads configuration settings from the specified XML configuration file.

  procedure Loaded; override;

  

Performs actions when LCL component streaming has been completed.

  procedure SaveContent(); override;

  

Saves configuration settings from SaveOptions and optionally values from Cells in the specified XML configuration file.

  procedure SelectionSetText();

  

Stores the specified Tab-separated values to the Selection in the grid.

  procedure SelectionSetHTML();

  

Sets the value for the current Selection to the specified HTML content.

  procedure SetCells(); virtual;

  

Sets the value for the indexed Cells property.

  procedure SetCheckboxState(); override;

  

Sets the checked state for a Checkbox in the specified cell.

  procedure SetEditText(); override;

  

Locks, updates, and unlocks the editor and cell text at the specified coordinates.

  property Modified: Boolean; [rw]

  

Indicates if the content in the grid cells has been changed.

  property OnCellProcess: TCellProcessEvent; [rw]

  

Event handler signalled when copying or pasting content for Cells in the grid.

public

  constructor Create(); override;

  

Constructor for the class instance.

  destructor Destroy; override;

  

Destructor for the class instance.

  procedure AutoSizeColumn();

  

Automatically adjusts the width of a column to accommodate the widest text value.

  procedure AutoSizeColumns;

  

Resizes all columns to fit in the longest text in each.

  procedure Clean();

  

Removes cell content using the specified options.

  procedure CopyToClipboard();

  

Copies the selection cell range to the clipboard.

  procedure InsertRowWithValues();

  

Inserts a row at the specified row position with the specified cell values.

  procedure LoadFromCSVStream(); virtual;

  

Loads the content for the grid from the delimited values in AStream.

  procedure LoadFromCSVFile();

  

Loads the grid from a file with delimited values for the columns and rows.

  procedure SaveToCSVStream();

  

Saves content in the grid as delimited values in the specified stream instance.

  procedure SaveToCSVFile();

  

Saves grid content as delimited values in the specified file name.

  property Cells []: string; [rw]

  

Provides indexed access to a cell value by its column and row number.

  property Cols []: TStrings; [rw]

  

Provides indexed access to the list of values for the specified column number.

  property DefaultTextStyle: TTextStyle;

  

Default style used to display text; includes alignment, layout, and wrapping.

  property EditorMode: Boolean;

  

True when the Editor is ready to modify the value for the current cell.

  property ExtendedSelect: Boolean;

  

Indicates whether a selection can extend beyond the visible boundary for he grid.

  property Objects []: TObject; [rw]

  

Provides indexed access to a TObject instance associated with the cell.

  property Rows []: TStrings; [rw]

  

Provides indexed access to the list of values for the specified row number.

  property UseXORFeatures: Boolean;

  

When True, the dotted focus rectangle is painted using an XOR raster operation.

  property ValidateOnSetSelection: Boolean;

  

Controls validation when the text for the selected cell is changed.

end;

Inheritance

TCustomStringGrid

  

The base class for TStringGrid.

|

TCustomDrawGrid

  

The base class for a custom-drawn grid control.

|

TCustomGrid

  

Implements the base class for grid controls.

|

TCustomControl

  

The base class for windowed controls which paint themselves.

|

TWinControl

  

Implements a windowed control which can contain other child controls.

|

TControl

  

The base class for visible controls.

|

TLCLComponent

  

The base class for LCL components which have an associated widget.

|

TObject

Description

TCustomStringGrid is a TCustomDrawGrid descendant which implements the base class for TStringGrid.

TCustomStringGrid provides the familar tabular format used in grid controls, and is designed for use with string content stored in its cells. Internally, columns and rows in the class are mapped to TStringGridStrings instances used to store the values in the grid control. TCustomStringGrid also allows a TObject instance to be stored for each cell in the grid using the Objects property.

See also

TCustomStringGrid.Cells

  

Provides indexed access to a cell value by its column and row number.

TCustomStringGrid.Cols

  

Provides indexed access to the list of values for the specified column number.

TCustomStringGrid.Rows

  

Provides indexed access to the list of values for the specified row number.

TCustomStringGrid.Objects

  

Provides indexed access to a TObject instance associated with the cell.

TCustomStringGrid.OnCellProcess

  

Event handler signalled when copying or pasting content for Cells in the grid.

HowToUseGrids

  

How to use Grids including StringGrids, DrawGrids and DbGrids.