Grid_ Class Properties and Methods

Properties

The following table lists the class properties. The properties listed include the standard Visual FoxPro class properties that the VPM Enterprise class uses and the VPM Enterprise custom properties. Where appropriate, the Comments column of the table describes a property and provides suggestions for its use.

Property & Initial Value

Comments

Standard Properties Used:

 

DeleteMark = .F.

 

FontBold = .F.

 

FontName = “Courier New”

 

FontSize = 9

 

Height = 200

 

Highlight = .F.

 

Name = “grid_”

 

RecordMark = .F.

 

RecordSource = “”

 

RowHeight = 22

 

Width = 300

 

Custom Properties:

 

cCSControlID = “”

The two-character ID used to identify the control when setting up Control Security.

i_cUse_ID = “”

A two-character ID used by the multilingual functionality to provide for the unique translation of a control’s properties.

i_lOverrideCaption = .F.

Used by the multilingual functionality to bypass the translation of the Caption property value.

i_lOverrideDragIcon = .F.

Used by the multilingual functionality to bypass the translation of the DragIcon property value.

i_lOverrideFont = .F.

Used by the multilingual functionality to bypass the translation of the Font property value.

i_lOverrideRecordSource = .F.

Used by the multilingual functionality to bypass the translation of the RecordSource property value.

i_lOverrideStatusBarText = .F.

Used by the multilingual functionality to bypass the translation of the StatusBarText property value.

i_lOverrideToolTipText = .F.

Used by the multilingual functionality to bypass the translation of the ToolTipText property value.

lGreenBar = .F.

If .T., causes the ledger style (alternating green and white rows) to be implemented. See the SetGreenBar method for more details.

lGridOverrideCaption = .F.

If .T., the header caption of the column containing this control will not be overwritten with the grid label (short description) stored in the DD.

lHighlightRow = .T.

If .T., causes the active row to be highlighted. See the SetHighlight method for more details.

Methods

The following table lists the class methods. The methods listed include the standard Visual FoxPro class methods that the VPM Enterprise class uses and the VPM Enterprise custom methods. Where appropriate, the Comments column of the table describes a method and provides suggestions for its use.

Method

Comments

Standard Methods Used:

 

Init

Calls the SetControlProperties method of the active form that fills-in generic control properties.

Refresh

Makes sure the RecordMark in the grid is updated when the record pointer is moved while the focus is not on the grid.

Valid

When clicking on an object that is outside a grid, VFP does not prevent the focus from being moved off the grid when the Valid method of the current control in the grid returns .F.. The code in this method forces the value of the current control in the grid to be validated. If the validation fails, this method returns .F., causing the focus to stay on the grid.

Custom Methods:

 

SetGreenBar

Called from the Init event to set the grid and column properties that cause the ledger style (alternating green and white rows) to be implemented. See the lGreenBar property for more details.

Note: This functionality is implemented through the use of the record number of each record, with even records appearing in green and odd records appearing in white. Because of the use of record numbers this functionality should only be used with cursors that are not ordered by an index tag and where records are not allowed to be added or deleted.

SetHighlight

Called from the Init event to set the grid properties that cause the active row to be highlighted. See the lHighlightRow property for more details.

WriteBuffer

Called by the Valid event to make sure the contents of the Value property of the current control is written to the field that is bound to the control before the value is validated.

More:

Grid_List Class Properties and Methods