Grid Works home page

Overview

Components
TgwGrid

Classes
TgwGridObject
TgwCell
TgwRow
TgwColumn

Additional Information
Grid Options
HTML Reference
Tips & Tricks

Feedback
Report a bug with this manual

How do you rate this manual?
Great
OK
Poor

Comments


Best viewed with
Microsoft Internet Explorer
Grid Options

The Option property contains many options for controlling the look and feel of your grids.

Options are grouped in the following categories :- Selection, Sizing, Moving, Editing, Appearance, Shading, Navigation and Synchronisation

Here are a couple of quick examples showing the use of the Option property


Example Set column and row selection on
Grid.Options.Selection.ColumnSelection := true;
Grid.Options.Selection.RowSelection := true;

Example Shade every alternate row in yellow
Grid.Options.Shading.Color := clYellow;
Grid.Options.Shading.Frequency := 1;


Selection Options (TgwGrid.Options.Selection)
Option Type Description
AlwaysShowSelection boolean If true the grid will show selected cells when it does not have the input focus. Usually selected cells are only displayed when the grid has the input focus
ColumnSelection boolean If true allows the user to select an entire column by clicking the topmost cell in that column
GridSelection boolean If true allows the user to select the entire grid by clicking cell[0,0]
MultiSelection boolean If true allows the user to select multiple cells, rows and columns by clicking and dragging the mouse. Non adjacent cells, rows and columns may be selected by holding down the control key
RowSelect boolean If true the row which contains the focused cell (i.e. the row indicated by TgwGrid.RowIndex) will be selected automatically
RowSelection boolean If true allows the user to select an entire row by clicking the leftmost cell in that row
SelectLocked boolean If true allows the user to select cells which have been locked. Usually locked cells cannot be selected
SelectionStyle TSelectionStyle ssSolid - Selected cells are displayed with a background color of clHighlight
ssOutline - Selected cells are displayed with a border of clHighlight. The background color of the cell is not changed
FocusStyle TSelectionStyle ssSolid - The focused cell (i.e. Grid.Cell[ColumnIndex, RowIndex]) is displayed with a background color of clHighlight
ssOutline - The focused cell is displayed with a border of clHighlight. The background color of the cell is not changed


Sizing Options (TgwGrid.Options.Sizing)
Option Type Description
ColumnSizing boolean If true columns may be resized by the user. Individual columns may be prevented from resizing by setting TgwColumn.Sizing to false
MaximumColumnWidth integer Specifies the maximum allowable width of any column during a resizing operation. If -1 then there is no maximum width
MaximumRowHeight integer Specifies the maximum allowable height of any row during a resizing operation. If -1 then there is no maximum height
MinimumColumnWidth integer Specifies the minimum allowable width of any column during a resizing operation
MinimumRowHeight integer Specifies the minimum allowable width of any row during a resizing operation
RowSizing boolean If true rows may be resized by the user. Individual rows may be prevented from resizing by setting TgwRow.Sizing to false


Moving Options (TgwGrid.Options.Moving)
Option Type Description
ColumnMoving boolean If true columns may be moved by the user. Individual columns may be prevented from being moved by setting TgwColumn.Moving to false
RowMoving boolean If true rows may be moved by the user. Individual rows may be prevented from being moved by setting TgwRow.Moving to false


Editing Options (TgwGrid.Options.Editing)
Option Type Description
ConfirmRowDelete boolean If true and the user attempts to delete a row by pressing CTRL Delete then the user will be asked to confirm the deletion
Editing boolean If true the inplace editor will be displayed
RowDelete boolean If true the current row may be deleted by pressing CTRL Delete
RowInsert boolean If true a new row may be inserted above the current row by pressing CTRL Insert


Appearance Options (TgwGrid.Options.Appearance)
Option Type Description
ColumnLines boolean If true column lines will be displayed
ExtendColumn boolean If true and the ColumnLines property is also true then column lines will extend to the bottom of the grid's client area and not just the last row. See the tip
ExtendRow boolean If true and the RowLines property is also true then row lines will extend to the right hand edge of the grid's client area.
RowLines boolean If true row lines will be displayed
LockFixed boolean If true fixed rows and columns will also be locked. If you wish to duplicate the behavior of Delphi's string grid set LockedFixed to true
ThreeDFixed boolean If true fixed rows and columns will be displayed with a 3D appearance. If you wish to duplicate the appearance of Delphi's string grid then set ThreeDFixed to true


Shading Options (TgwGrid.Options.Shading)
Option Type Description
Color TColor Rows which are shaded will have this background color.See the tip
Frequency integer Frequency determines the number of adjacent rows which are shaded.
To shade every alternate row set Frequency to 1.
To shade every three alternate rows set Frequency to 3.
And so on...
To turn off shading set Frequency to 0.


Navigation Options (TgwGrid.Options.Navigation)
Option Type Description
Tabs boolean If true pressing the TAB key will cause the focus to shift to the next cell in the row. Pressing Shift TAB will cause the focus to shift to the previous cell in the row.
If false pressing the TAB key will cause the focus to shift to the next control in the form's tab order


Synchroniser Options (TgwGrid.Options.Synchroniser)
Option Type Description
Synchroniser TgwGridSynchroniser To synchronize multiple grids set this property to the TSynchronizer component you wish to control synchronization




Copyright © 1998-2007 Innova Software ALL RIGHTS RESERVED
All trademarks are the property of their respective owners.
Webmaster webmaster@innovasoftware.com