You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Grid - EditorChanged Event
Fired when the user changes a value in an editable cell
Member of Grid (PRIM_GRID)

Parameters

Name

Type

Data Type

Description

Value

*Input

Variant

Value entered in the cell

Details


The EditorChanged event is fired when a change is made in the editor for the column. For example, in an edit box editor the event is fired on each keystroke.
The event occurs before the underlying working list is updated. This means that the corresponding field value in the list will be different to that of the Value parameter.

Example


In the example below, the surname and givename columns can be edited.
Function Options(*DIRECT)
Begin_Com Role(*EXTENDS #PRIM_FORM) Clientwidth(792) Clientheight(394) Componentversion(2) Top(227) Left(222) Layoutmanager(#TableLayout1)
Define_Com Class(#PRIM_TBLO) Name(#TableLayout1)
Define_Com Class(#PRIM_TBLO.Column) Name(#Column1) Displayposition(1) Parent(#TableLayout1)
Define_Com Class(#PRIM_TBLO.Row) Name(#Row1) Displayposition(1) Parent(#TableLayout1)
Define_Com Class(#PRIM_TBLO.Item) Name(#LayoutItem1) Column(#Column1) Manage(#Grid) Parent(#TableLayout1) Row(#Row1)
Define_Com Class(#PRIM_GRID) Name(#Grid) Captionnoblanklines(True) Columnscroll(False) Componentversion(1) Displayposition(1) Height(394) Left(0) Parent(#COM_OWNER) Showselection(True) Showselectionhilight(False) Showsortarrow(True) Tabposition(1) Top(0) Width(792) Columnbuttonheight(25) Rowheight(28) Columnellipses(End)
Define_Com Class(#PRIM_GDCL) Name(#GridColumn1) Displayposition(1) Parent(#Grid) Source(#EMPNO)
Define_Com Class(#PRIM_GDCL) Name(#GridColumn2) Displayposition(2) Parent(#Grid) Source(#SURNAME) Readonly(False)
Define_Com Class(#PRIM_GDCL) Name(#GridColumn3) Displayposition(3) Parent(#Grid) Source(#GIVENAME) Readonly(False)
Evtroutine Handling(#Com_Owner.CreateInstance)
Select Fields(#Grid) From_File(pslmst)
Add_Entry To_List(#Grid)
Endselect
Endroutine
Evtroutine Handling(#Grid.EditorChanged) Value(#Value)
If (#Grid.FocusCell.Column *IsEqualTo #GridColumn2)
#Com_owner.Caption := ("New value - &1, Old value &2").Substitute( #Value #Surname )
Endif
If (#Grid.FocusCell.Column *IsEqualTo #GridColumn3)
#Com_owner.Caption := ("New value - &1, Old value &2").Substitute( #Value #Givename )
Endif
Endroutine
End_Com

See also

All Component Classes
Technical Reference

  • No labels