Change background color of grid header / listview header

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
User avatar
Joop
Posts: 13
Joined: Tue Dec 01, 2015 2:38 am
Location: The Netherlans
Contact:

Change background color of grid header / listview header

Post by Joop » Tue Sep 01, 2020 11:14 pm

Hi all,

I was wondering if it is at all possible to change the background color of a grid header / listview header in Visual Lansa? If so, can anyone tell me how to do that? I have applied a visual style (or style) but then the background of the whole grid/list view changes.
--
Regards,
Joop Roseboom

jyoung
Posts: 690
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Re: Change background color of grid header / listview header

Post by jyoung » Wed Sep 02, 2020 1:01 am

For VLWEB and the PRIM_LIST control, you can set the ColumnStyle on the list.

Code: Select all

begin_com role(*EXTENDS #PRIM_WEB) LayoutManager(#Layout1)

define_com class(#PRIM_VS.Style) name(#Style1) BackgroundBrush(#Brush1)
define_com class(#PRIM_VS.SolidBrush) name(#Brush1) Color(0:150:136)

define_com class(#PRIM_TBLO) name(#Layout1)
define_com class(#PRIM_TBLO.Row) name(#Layout1Row1) DisplayPosition(1) Parent(#Layout1)
define_com class(#PRIM_TBLO.Column) name(#Layout1Column1) DisplayPosition(1) Parent(#Layout1)


define_com class(#PRIM_LIST) name(#List) ColumnHeaderHeight(48) ColumnLines(False) DisplayPosition(1) Height(360) Left(293) Parent(#COM_OWNER) RowHeight(48) TabPosition(1) Top(142) Width(500) ColumnStyle(#Style1)
define_com class(#PRIM_LIST.String) name(#ListColumn1) ColumnWidth(250) DisplayPosition(1) Parent(#List) SortOnClick(True) Source(#STD_TEXT)

evtroutine handling(#Com_owner.Initialize)
define_com class(#PRIM_NMBR) name(#lIndex)


#lIndex := 1
dowhile cond(#lIndex <= 10)
#STD_TEXT := #lIndex.AsString
add_entry to_list(#List)
#lIndex += 1
endwhile

endroutine

end_com
Capture.PNG
Capture.PNG (6.19 KiB) Viewed 884 times
Hope this helps,
Joe

User avatar
Joop
Posts: 13
Joined: Tue Dec 01, 2015 2:38 am
Location: The Netherlans
Contact:

Re: Change background color of grid header / listview header

Post by Joop » Wed Sep 02, 2020 2:12 am

Hi Joe,

Thanks, but I am programming for good ol' Windows :-) So I'm using a grid and list view in a reusable part.
--
Regards,
Joop Roseboom

Post Reply