Home > Archive > PowerBuilder > March 2004 > PB 9.x Datawindow, changing cell color programatically ?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
PB 9.x Datawindow, changing cell color programatically ?
|
|
| Gwood 2004-03-27, 12:22 am |
| I'm sure there's a way to do this, but so far I'm batting zero.
I have DW_1 with 20 columns. It has been loaded from an external source,
and I'm spinning thru the rows validating various data elements. When I
find a bad piece of data, I want to turn the column/row combination a
different color.
I know this can be done by specifying an expression for the column.color or
font.weight in the DW expression, but I'd like to do it programmatically
from a window function.
ie. dw_1.Object.entry_number[li_row].Text.Color = rgb(255,0,0)
Any hints on where I'm going wrong ?
Tnx
| |
| Bruce Armstrong [TeamSybase] 2004-03-27, 12:22 am |
| You can't do it externally, because any changes you make that way apply
to all rows. You have to do it through an expression. What you might
consider is having the expression reference a computed column, and then
set the value of that externally. Since it's a computed column, it can
support variation by row.
Gwood wrote:
>
> I'm sure there's a way to do this, but so far I'm batting zero.
>
> I have DW_1 with 20 columns. It has been loaded from an external source,
> and I'm spinning thru the rows validating various data elements. When I
> find a bad piece of data, I want to turn the column/row combination a
> different color.
>
> I know this can be done by specifying an expression for the column.color or
> font.weight in the DW expression, but I'd like to do it programmatically
> from a window function.
>
> ie. dw_1.Object.entry_number[li_row].Text.Color = rgb(255,0,0)
>
> Any hints on where I'm going wrong ?
>
> Tnx
--
Bruce Armstrong [TeamSybase]
http://www.teamsybase.com
Who uses PowerBuilder in 2003?
http://www.visual-expert.com/us/info/survey_pb_2003.htm
Two new books on developing with PowerBuilder
http://www.pb9books.com?source=newsgroups
Got code samples? Check out CodeXchange:
http://www.codexchange.sybase.com
ISUG Enhancement Requests
http://www.isug.com/cgi-bin/ISUG2/submit_enhancement
Preach the gospel at all times. If necessary, use words. - Francis of
Assisi
http://www.needhim.org
| |
| Gwood 2004-03-27, 12:22 am |
| Thanks. I was pretty sure it could be done, guess I'm confusing it with
another DW approach. Enhancement?
FYI, I decided to add a message field to the DW, and loaded it with a text
error message programatically. Probably more user friendly than the
"colored field" approach, but not nearly as much fun...
Cheers
Gary
"Bruce Armstrong [TeamSybase]" <NOCANSPAM_bruce.armstrong@teamsybase.com>
wrote in message news:400D8C68.5A04020A@teamsybase.com...
> You can't do it externally, because any changes you make that way apply
> to all rows. You have to do it through an expression. What you might
> consider is having the expression reference a computed column, and then
> set the value of that externally. Since it's a computed column, it can
> support variation by row.
>
> Gwood wrote:
source,[color=darkred]
or[color=darkred]
>
> --
> Bruce Armstrong [TeamSybase]
> http://www.teamsybase.com
>
> Who uses PowerBuilder in 2003?
> http://www.visual-expert.com/us/info/survey_pb_2003.htm
>
> Two new books on developing with PowerBuilder
> http://www.pb9books.com?source=newsgroups
>
> Got code samples? Check out CodeXchange:
> http://www.codexchange.sybase.com
>
> ISUG Enhancement Requests
> http://www.isug.com/cgi-bin/ISUG2/submit_enhancement
>
> Preach the gospel at all times. If necessary, use words. - Francis of
> Assisi
> http://www.needhim.org
| |
| Philip Salgannik 2004-03-27, 12:22 am |
| Actually you can achieve a similar effect by using .selected property.
An old framework (APOL) was using it to indicate empty required fields on a
multirow datawindow at validation time...
--
__
"Gwood" <sorry@nothere.com> wrote in message
news:bukcvu$i5pib$1@ID-196047.news.uni-berlin.de...
> Thanks. I was pretty sure it could be done, guess I'm confusing it with
> another DW approach. Enhancement?
>
> FYI, I decided to add a message field to the DW, and loaded it with a text
> error message programatically. Probably more user friendly than the
> "colored field" approach, but not nearly as much fun...
>
> Cheers
> Gary
>
> "Bruce Armstrong [TeamSybase]" <NOCANSPAM_bruce.armstrong@teamsybase.com>
> wrote in message news:400D8C68.5A04020A@teamsybase.com...
> source,
I[color=darkred]
column.color[color=darkred]
> or
programmatically[color=darkred]
>
>
|
|
|
|
|