Field Name
SEX (Alpha 1)
Description
How to visualize a field as a ComboBox in a grid.
1. Through the Field Component source add a Picklist visualization ( PRIM_EVPL ) and a Picklist. Note that these are separate classes in the Field source. Add PicklistItems for Male and Female to the Picklist.
2. Save the field.
3. Create a grid component. From the fields tab add the SEX field to the grid as a column. Set the following properties on the column:
ReadOnly = FALSE.
DisplayAppearance=Edit
EditAppearance=Edit
UsePicklist = TRUE.
3. Load the grid and the column can be edited as a dropdown combo.
Field Source
Begin_Com Role(*EXTENDS #PRIM_OBJT)
Begin_Com Role(*Visual #PRIM_EVEF) Name(#VisualEdit) Defaultvisual(True) Height(19) Usepicklist(False) Width(178)
End_Com
Begin_Com Role(*picklist) Name(#LIST)
Define_Com Class(#PRIM_PKIT) Name(#ITEM1) Caption('Male') Default(True) Parent(#LIST) Value('M')
Define_Com Class(#PRIM_PKIT) Name(#ITEM2) Caption('Female') Parent(#LIST) Value('F')
End_Com
Begin_Com Role(*Visual #PRIM_EVPL) Name(#VisualPicklist) Appearance(DropDownList) Height(69) Width(209)
End_Com
End_Com
Form Source
Function Options(*DIRECT)
Begin_Com Role(*EXTENDS #PRIM_FORM) Clientheight(147) Clientwidth(492) Height(174) Left(369) Top(152)
Define_Com Class(#PRIM_GRID) Name(#GRID) Captionnoblanklines(True) Componentversion(1) Displayposition(1) Height(128) Left(40) Parent(#COM_OWNER) Showbuttonselection(True) Showselection(True) Showselectionhilight(False) Showsortarrow(True) Tabposition(1) Top(8) Width(344)
Define_Com Class(#PRIM_GDCL) Name(#GDCL) Displayappearance(Edit) Displayposition(1) Editappearance(Edit) Parent(#GRID) Readonly(False) Source(#SEX) Usepicklist(True) Width(30)
Evtroutine Handling(#COM_OWNER.CreateInstance) Options(*NOCLEARMESSAGES *NOCLEARERRORS)
Select Fields(#SECTION) From_File(PSLMST)
Add_Entry To_List(#GRID)
Endselect
Endroutine
End_Com
Appearance