The base class for all grid controls

A grid is a collection of cells that are organized in columns and rows. Grids are adequate to show data that have tabular nature, for example tables in a database.

Key properties:

The ColCount and RowCount properties contain the column and row count of the grid.

The FixedCols and FixedRows properties specify the count of fixed columns or rows that are used for headings.

The column widths and row heights of the grid are accessible with the ColWidths and RowHeights properties.

The DefaultColWidth and DefaultRowHeight properties are used to specify default column widths or row heights respectively.

The colors of the cells and the grid elements are specified with the AlternateColor, BorderColor, FixedColor, FixedHotColor, FocusColor, GridLineColor and SelectedColor properties. The GridWidth and GridHeight properties contain the dimension of the entire grid.

The ScrollBars property controls the creation of scrollbars for the grid.

The LeftCol, TopRow, VisibleColCount and VisibleRowCount properties contain information about the visible area of the grid.

The Options property controls options for the grid.

Key methods and events:

If the user highlights a cell of the grid, the SelectCell method is called that triggers the OnSelectCell event. The position of the highlighted cell is stored within the Col and Row property.

The MouseToCell method calculates a grid cell from a given screen position.

Huge changes to the grid should be encapsulated in calls to BeginUpdate and EndUpdate to speed up the application.

Component developers must override the DrawCell method in customized grids.

Read specifier for LeftCol Read specifier for ColWidths Read specifier for RowHeights Returns the current rowheight Read specifier for TopRow Read specifier for VisibleRowCount Write specifier for Col Write specifier for RawColWidths Write specifier for ColCount Write specifier for DefColWidth Write specifier for DefRowHeight Write specifier for Editor Write specifier for FixedCols Write specifier for FixedRows Write specifier for GridLineColor Write specifier for LeftCol Write specifier for Options Write specifier for Row Write specifier for RowCount Write specifier for ScrollBars Write specifier for TopRow Before move selection method. This method is called from TCustomGrid.MoveExtend method whenever the current grid cursor location is about to change. The destination column and row are specified in DCol and DRow parameters respectively. The new location is known to be a valid selectable cell (see ), and is given in absolute cell coordinates. At this point the current grid location has not changed and can be retrieved with Col and Row properties. The purpose of this method is to call event handler OnBeforeSelection. ScrollBarShow method Change the appearance of the scrollbars in the grid. 'Which' can be any of : SB_BOTH, SB_VERT, SB_HORZ 'aValue' can be True or False ScrollBarAutomatic method Check if scrollbars are shown automatically by the grid or not. 'Which' can be any of : SB_BOTH, SB_VERT, SB_HORZ Is called if a grid cell is highlighted.

The SelectCell method is called if a grid cell will be highlighted.

The aCol and aRow parameters contain the column and the row of the highlighted cell.

Component developers may use the SelectCell method to react on focus changes. The Result is true if the cell is allowed to be selected. Application developers should use the OnSelectCell event instead.

Sort method Method to sort all items in the grid Current column index. Col property holds the column index of the current grid cell cursor. The current grid column can be changed programatically by setting a new value to this property. Number of columns of the grid. This is the number of columns in the grid, including fixed and normal columns. Column widths for the grid.

The column is specified with the aCol parameter. The aCol parameter must fall within the valid index range of 0 to ColCount-1.

The return value of the property is the width of this column, measured in pixels.

The initial width of a newly created column is specified with the DefaultColWidth property. After that the user may redefine this value.

If the Options property includes the appropriate value, the column width may also be changed by the user at runtime.

Default value for the width of newly created grid columns.

If new columns of the grid are created by changing the ColCount property, the width of these new columns will be set to the value of the DefaultColWidth property.

After that the user may redefine this value. If the Options property includes the appropriate value, the column width may also be changed by the user at runtime.

Default value for the height of newly created grid rows.

If new rows of the grid are created by changing the RowCount property, the height of these new rows will be set to the value of the DefaultRowHeight property.

After that the user may redefine this value. If the Options property includes the appropriate value, the row height may also be changed by the user at runtime.

Number of the fixed columns of the grid.

Contains the fixed column count of a grid.

Fixed columns are normally used for headings.

Number of the fixed rows of the grid.

Contains the fixed row count of a grid.

Fixed rows are normally used for headings.

The color for the fixed cells of the grid. The color used by headings. Number of rows in the grid This is the number of rows in the grid, including fixed and normal rows. The row heights for the grid.

The row is specified with the aRow parameter. The aRow parameter must fall within the valid index range of 0 to RowCount-1.

The return value of the property is the height of this row, measured in pixels.

The initial height of a newly created row is specified with the DefaultRowHeight property. After that the user may redefine this value. If the Options property includes the appropriate value, the row height may also be changed by the user at runtime.

Is called after a grid cell is highlighted. The Col and Row parameters contain the column and the row of the highlighted cell. Application developers may use the OnSelection and OnBeforeSelection events to react on focus changes. Component developers should use the SelectCell method instead. clear all cells from the grid.

Reset Column and Row counts to 0. Grid is completely emptied.

Compatibility: This property applies to Lazarus grids only , under Delphi/Kylix a grid can't be completly emptied.

Draw rubberband rect Draw a rubberband around the provided cellrect Segunda linea de texto