List Column (PRIM_LIST.Column)

Base class for all columns

Ancestors - Object (PRIM_OBJT)

Details

Column is the base class for all column type in the List control.
 
Unlike other component LANSA lists e.g. Tree and Grid, where column types are generic, Prim_List has specific column types for string, number,  date time, image, button, check box and reusable part.
 
When a field or control is dropped on the list, the appropriate type of column is added. If it was a field, the source parameter of the column will be set as it is for other LANSA lists.
 
Columns work in 2 ways. Firstly, the definition of the column is used as a prototype when an entry is added. So, a button column defined with a caption of "Delete" will show a button in each item with a caption of "Delete". Secondly, all column types have a CurrentItem property that provides access to the individual instance.

Example

This example shows a simple list with a number and button columns. The button is hidden if the row is an even numbered row.
Begin_Com Role(*EXTENDS #PRIM_WEB) Height(456) Width(864) 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(#List1Item1) Column(#Column1) Manage(#List) Parent(#TableLayout1) Row(#Row1)
 
   Define_Com Class(#PRIM_LIST) Name(#List) Displayposition(1) Left(0) Parent(#COM_OWNER) Tabposition(1) Top(0) Height(456) Width(864) Rowheight(33)
   Define_Com Class(#PRIM_LIST.Number) Name(#ColumnXDEMONUMB1) Displayposition(1) Increment(1) Parent(#List) Source(#xDemoNumber) Wrap(False)
   Define_Com Class(#PRIM_LIST.Button) Name(#ColumnButton1) Columnwidth(100) Displayposition(2) Parent(#List) Caption('Delete') Cellsizing(None) Cellwidth(80)
 
   Evtroutine Handling(#Com_Owner.CreateInstance)
 
      Begin_Loop Using(#xDemoNumber) To(10)
 
         Add_Entry To_List(#List)
 
         #ColumnButton1.CurrentItem.Visible := (#xDemoNumber.mod( 2 ) = 0)
 
      End_Loop
 
   Endroutine
 
   Evtroutine Handling(#ColumnButton1.Click)
 
      Dlt_Entry Number(#List.CurrentItem.Entry)
 
   Endroutine
 
End_Com

Properties

NameDescription
CellAlignmentPosition of the content of a list cell.
CellHeightHeight of the cell in pixels when not overridden by CellSizing
CellMarginBottomBottom margin of the cell in pixels when not overridden by CellSizing
CellMarginLeftLeft margin of the cell in pixels when not overridden by CellSizing
CellMarginRightRight margin of the cell in pixels when not overridden by CellSizing
CellMarginTopTop margin of the cell in pixels when not overridden by CellSizing
CellSizingSizing behavior of a list cell allowing for the content to only use a portion of the cell
CellWidthWidth of the cell in pixels when not overridden by CellSizing
ColumnCaptionCaption displayed in the column header
ColumnCaptionAlignAlignment of the text in the column header
ColumnCaptionTextCaption displayed in the column header
ColumnCaptionWordWrapWrap text on to the next line if there is insufficient space
ColumnImageImage to be show in the column heading
ColumnImageHeightSet the height and width of the column image in pixels
ColumnMaxWidthMaximum allow width of the column in pixels
ColumnMinWidthMinimum allow width of the column in pixels
ColumnMouseOverStyleStyle to be applied to the column header on mouseOver
ColumnMouseOverStylesCollection of styles to be applied to the column header on mouseOver
ColumnPinnedPin the column to the left or right hand sides of the list
ColumnPopupPopup Panel to display as a menu
ColumnPopupImageImage to display in the column header in place of the default image
ColumnPressedStyleStyle to be applied to the column header on click
ColumnPressedStylesCollection of styles to be applied to the column header on mouseOver
ColumnResizeSpecifies whether the column can be manually resized
ColumnStyleStyle to be applied to the column
ColumnStylesCollection of styles to be applied to the column
ColumnThemeDrawStyleName of the Theme DrawStyle to be applied to the column heading
ColumnUnitsSpecifies whether the column is a specific width or uses a proportion of the available space (See ColumnWidth)
ColumnVisibleShow or hide the column
ColumnWidthWidth of the column. See the ColumnUnits property
ComponentClassNameComponentClassName is the name of the component's class. Inherited from Object (PRIM_OBJT)
ComponentMembersComponentMembers provides access to all the member components of this component Inherited from Object (PRIM_OBJT)
ComponentPatternNameComponentPatternName is used to qualify the class of the component. Inherited from Object (PRIM_OBJT)
ComponentTagGeneric space allowing a value to be stored for the instance Inherited from Object (PRIM_OBJT)
ComponentTypeComponentType gives you access to the type information about the component Inherited from Object (PRIM_OBJT)
ComponentTypeNameComponentTypeName is the fully qualified name of the component's class. Inherited from Object (PRIM_OBJT)
CurrentItemThe last item in the column touched either in the UI or via a list related command
DisplayPositionPosition of the column relative to the other columns
EnabledEnable or disable the column contents
FocusItemReference to the focus item in the column
NameName identifies the component Inherited from Object (PRIM_OBJT)
OwnerOwner owns this component Inherited from Object (PRIM_OBJT)
ParentReference to the list containing the column
SortAsColumnSpecifies an alternate column to use to sort the data
SortDirectionSort the column ascending or descending
SortPositionPosition of the column in the sort sequence
StyleStyles to be applied to the item
StylesCollection of styles to be applied to the item
ThemeDrawStyleThemeDrawStyle to be applied to the column
VisibleShow or hide the content of a cell

Events

NameDescription
ColumnClickFired when the column header is clicked
Origin, Handled
ColumnDoubleClickFired when the column header is DoubleClicked
Origin, Handled
ColumnMouseEnterFired when the mouse enters the bounds of the column
ColumnMouseLeaveFired when the mouse leaves the bounds of the column
CreateInstanceCreateInstance is signalled when an instance of a component is created Inherited from List Column (PRIM_LIST.Column)
DestroyInstanceDestroyInstance is signalled when an instance of a component is about to be destroyed Inherited from List Column (PRIM_LIST.Column)

Methods

NameDescription
SizeToContentsSet the column width to the widest content

See also

All Component Classes

Technical Reference

LANSA Version 15, April 2020