VL-Web Applying style to cell of list control

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
MegumiSawada
Posts: 80
Joined: Tue Mar 22, 2016 1:45 pm
Location: Tokyo, Japan

VL-Web Applying style to cell of list control

Post by MegumiSawada »

Hi,

The customer would like to apply a style to the specific cell of list control.
Could you please give me an advice?

Code: Select all

Begin_Com Role(*EXTENDS #PRIM_WEB) Height(608) Width(1184)
Define_Com Class(#PRIM_VS.Style) Name(#Style1) Backgroundbrush(#Brush1)
Define_Com Class(#PRIM_VS.SolidBrush) Name(#Brush1) Color(255:29:224)

Define_Com Class(#PRIM_LIST.String) Name(#ColumnEMPNO) Displayposition(1) Parent(#List2) Source(#EMPNO) Columnwidth(143) Style(#Style1)
Define_Com Class(#PRIM_LIST) Name(#List2) Displayposition(1) Left(0) Parent(#COM_OWNER) Tabposition(1) Top(0) Height(201) Width(833)
Define_Com Class(#PRIM_PHBN) Name(#Button1) Caption('Button1') Displayposition(2) Left(622) Parent(#COM_OWNER) Tabposition(2) Top(238)

Evtroutine Handling(#Com_owner.Initialize)
#COM_OWNER.SET_LIST
Endroutine

Mthroutine Name(SET_LIST)
#EMPNO := 'A0001'
Add_Entry To_List(#List2)
#EMPNO := 'A0002'
Add_Entry To_List(#List2)
#EMPNO := 'A0003'
Add_Entry To_List(#List2)
#EMPNO := 'A0004'
Add_Entry To_List(#List2)
#EMPNO := 'A0005'
Add_Entry To_List(#List2)
Endroutine

Evtroutine Handling(#Button1.Click)
Define Field(#PGMCUNT) Type(*DEC) Length(10) Decimals(0)
#PGMCUNT := 0
Selectlist Named(#List2)
#PGMCUNT += 1
Case Of_Field(#PGMCUNT)
When Value_Is(= 2 = 4)
*****Here they would like to apply style to the cell #ColumnEMPNO *****
#ColumnEMPNO.CurrentItem.ReadOnly := True
Otherwise
#ColumnEMPNO.CurrentItem.ReadOnly := False
Endcase
Endselect
Endroutine
End_Com
Thank you in advance.

Best Regards,
Megumi Sawada
User avatar
Stewart Marshall
Posts: 417
Joined: Thu Nov 05, 2015 5:25 pm

Re: VL-Web Applying style to cell of list control

Post by Stewart Marshall »

Hi Megumi

The Style and MousoverStyle for an individual cell can be addressed as follows

Code: Select all

#ColumnXxxxx.CurrentItem.Style <= #Style
#ColumnXxxxx.CurrentItem.MouseOverStyle <= #Style
Regards
Stewart Marshall

Independent IT Consultant
www.marshallfloyd.com.au
MegumiSawada
Posts: 80
Joined: Tue Mar 22, 2016 1:45 pm
Location: Tokyo, Japan

Re: VL-Web Applying style to cell of list control

Post by MegumiSawada »

Hi Stewart,

It worked! Thank you!

Best Regagrds,Megumi
Post Reply