Visual Style in Grid Cell (SOLVED)

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
PhilA
Posts: 8
Joined: Fri Feb 01, 2019 6:32 pm

Visual Style in Grid Cell (SOLVED)

Post by PhilA » Wed Jul 24, 2019 6:08 pm

Hi,

If is possible to change the visual style of part of a cell in a grid.

I have a grid cell field that is 100 characters and I would like to change some of the text to a different visual style

User avatar
lawingo
Posts: 51
Joined: Fri Dec 04, 2015 6:41 am

Re: Visual Style in Grid Cell

Post by lawingo » Thu Jul 25, 2019 4:11 am

Try this:

Code: Select all

Set Com(#GridColumn6.Cell<1>.Column) VisualStyle(#FS_BLUE) 
#GridColumn6 is the name of the Column in your list
<1> is the Record Number

PhilA
Posts: 8
Joined: Fri Feb 01, 2019 6:32 pm

Re: Visual Style in Grid Cell (SOLVED)

Post by PhilA » Fri Aug 02, 2019 12:17 am

Hi lawingo,

Thanks for the reply but unless im mistaken this will change the whole cell to #FS_BLUE).

I want to know if there is any way to change part of the cell to a different visual style (eg change the 4-5 character to #FS_BLUE

Set Com(#GridColumn6.Cell<1>.Column) VisualStyle(#FS_BLUE)

soa
Posts: 306
Joined: Mon Dec 07, 2015 3:15 pm

Re: Visual Style in Grid Cell (SOLVED)

Post by soa » Fri Aug 02, 2019 8:32 am

If you want to change the colour of a sub-string of text in a cell you could create a reusable part containing a html control then set the text colour using html eg 'Hello <span style="color:blue">world<span>

PhilA
Posts: 8
Joined: Fri Feb 01, 2019 6:32 pm

Re: Visual Style in Grid Cell (SOLVED)

Post by PhilA » Mon Aug 05, 2019 5:35 pm

Hi Soa,

Thanks for your reply..

That sounds more promising...Would it be possible to use the reusable in a grid as there would be many lines that may need to be changed

soa
Posts: 306
Joined: Mon Dec 07, 2015 3:15 pm

Re: Visual Style in Grid Cell (SOLVED)

Post by soa » Mon Aug 05, 2019 5:54 pm

You can use a reusable in a grid. I did it a couple of years back. If you search this forum, you should fine some sample code. You need to experiment to see what the performance is like before committing to it as it wasn't great then but a lot of work has been done in this area since.

PhilA
Posts: 8
Joined: Fri Feb 01, 2019 6:32 pm

Re: Visual Style in Grid Cell (SOLVED)

Post by PhilA » Mon Aug 05, 2019 6:57 pm

Hi Soa,

I have found some examples of reusable in a grid but when i try to create a reusable using the HTML control
I get a message saying #PRIM_WEB.HtmlContainer is only supported on the web...

I am trying to use the grid in a Framework (Not on a webpage)

soa
Posts: 306
Joined: Mon Dec 07, 2015 3:15 pm

Re: Visual Style in Grid Cell (SOLVED)

Post by soa » Tue Aug 06, 2019 8:54 am

Sorry, I assumed that you were in VL Web land. In This case I don't know if what you ant can be achieved.

Post Reply