PowerBuilder Bug – Autosize height and font color

Posted on Friday, August 13th, 2010 at 8:20 pm in

This bug occurs in version 11.5.1 Build 4608. I’m not sure of other versions at this point.

One of the many great features of the datawindow is the ability to create expressions on various object properties. This can greatly reduce coding for ‘eye candy’ type stuff throughout an application. A very common use is to change the text color of a row based on some criteria. I ran into an issue with this on a grid datawindow which had some columns which where set up to ‘autosize height’. Autosize height on a column (and the band the column is contained within), allows for a dynamic expansion (moving downward) of the display when the data (usually character data) is larger than the current size of the column.

Here is an example of the issue I came across:

First we have the rows as retrieved showing in red.

When we click the checkbox the color is changed to black via an expression on the font.color property. However, in my case I got this.

The solution is to redraw the datawindow object. This is supposed to happen automatically but to make sure we will call setredraw() on the datawindow ourselves.

Create event with the following

// posted from itemchanged to fix PB bug with text color on autosized height columns
dw_1.setredraw(TRUE)

In the itemchanged event on the datawindow (dw_1 in the above example), post a call to this new event.

parent.event post we_autosizeon()
You might also be interested in

Top