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
TgwColumn

Unit: gwGrid

Ancestor: TgwGridObject

Properties
Field, Width, Cell, Stretch, X, Index, Sizing, Moving,

Methods
Assign,



Properties
Field

property Field : string;

Description Use Field to specify the underlying database field that is attached to this column.

Please note This property is only used with data grids (TgwDataGrid)

Width

property Width : integer;

Description Use Width to set the width of the column.

Default A column's default width is determined by the grid's DefaultColWidth property

See also TgwCustomGrid

Example Set width of column[2] to 60 pixels

Grid.Column[2].Width := 60;

Cell

property Cell[Row : Integer]: TCell;

Description Use Cell to reference the Cell in row Row on this column.

Example Set text of cell[3] to 'Hello' for column[0]

Grid.Column[0].Cell[3].Text := 'Hello';

Stretch

property Stretch : boolean;

Description Use Stretch to specify whether the column's width will automatically stretch so that there is no gap at the right hand side of the grid.

'Stretchy' columns will be resized whenever the grid is resized.


Default false

Example Make column[0] stretch

Grid.Column[0].Stretch := true;

X

property X : integer; Read only


Description Use X to determine the horizontal position of the column.


Index

property Index : integer;

Description Use Index to determine the column index of the column, or to move the column to a new position.

The first column has an index of 0 and the last column has an index of Grid.ColCount - 1.


Example Swap the first and second columns

Grid.Column[0].Index := 1;

Example Move the third column (column[2]) to the left hand side of the grid

Grid.Column[2].Index := 0;

Sizing

property Sizing : boolean;

Description Use Sizing to specify whether the user is allowed to resize the column.

The prevent the user from sizing the column set Sizing to false.


Default true

See also Moving

Example Prevent user from sizing column[0]

Grid.Column[0].Sizing := false;

Moving

property Moving : boolean;

Description Use Moving to specify whether the user is allowed to move the column.

The prevent the user from moving the column set Moving to false.


Default true

See also Sizing

Example Prevent user from moving column[0]

Grid.Column[0].Moving := false;


Methods
Assign

procedure Assign(AColumn : TColumn; Ignore : TInheritOptions); virtual;

Description Call Assign to assign one Column to another.

Any properties specified by the Ignore parameter with not be assigned.


Example Assign Column[2] to Column[3] but do not assign any Font properties

Grid.Column[3].Assign(Grid.Column[2],
                      [ptFontName, ptFontBold,
                      ptFontItalic, ptFontUnderline,
                      ptFontStrikeout, ptFontSize]);



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