Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Grid Control - Individual Row Background Color

I need to be able set/control the back color of each row in a grid
individually. I am currently using the flexgrid control but this is too slow
as I can't bind the data to the control(at least not that I know of), and
therefore have to manually insert each row from the data source and set the
properties and colors appropriately. I can actually see the screen painting
and once the record count hits more than 20, it's too slow.

Is there a bound data grid available to do this - either free with vfp or
one for purchase?

Thanks.

Mark
[595 byte] By [Mark Kirchner] at [2007-11-10 12:49:25]
# 1 Re: Grid Control - Individual Row Background Color
On Tue, 29 Apr 2003 19:20:59 -0700, "Mark Kirchner"
<markkirchner@lvcm.com> wrote:

>I need to be able set/control the back color of each row in a grid
>individually. I am currently using the flexgrid control but this is too slow
>as I can't bind the data to the control(at least not that I know of), and
>therefore have to manually insert each row from the data source and set the
>properties and colors appropriately. I can actually see the screen painting
>and once the record count hits more than 20, it's too slow.
>

Can you do what you need with the DynamicBackColor property?

Tamar
Tamar E. Granor at 2007-11-11 23:51:04 >
# 2 Re: Grid Control - Individual Row Background Color
I don't think so. I tried using the example they give in the help, and I can
alternate colors using the example code as follows:

frmMyForm.grdGrid1.SetAll("DynamicBackColor", ;
"IIF(MOD(RECNO( ), 2)=0, RGB(255,255,255) , RGB(0,255,0))", "Column")

but when I modify the example code with another embedded iif() statement, it
doesn't work. All rows are white.

frmMyForm.grdGrid1.SetAll("DynamicBackColor", ;
"IIF(dbfs.field_type='C', RGB(255,255,255), IIF(field_type='N',
RGB(255,0,0), RGB(0,255,0))", "Column")

Mark

<Tamar E. Granor> wrote in message
news:inivavgior62vsrs5eioqu3phmui0dkqpn@4ax.com...
> On Tue, 29 Apr 2003 19:20:59 -0700, "Mark Kirchner"
> <markkirchner@lvcm.com> wrote:
>
> >I need to be able set/control the back color of each row in a grid
> >individually. I am currently using the flexgrid control but this is too
slow
> >as I can't bind the data to the control(at least not that I know of), and
> >therefore have to manually insert each row from the data source and set
the
> >properties and colors appropriately. I can actually see the screen
painting
> >and once the record count hits more than 20, it's too slow.
> >
>
> Can you do what you need with the DynamicBackColor property?
>
> Tamar
Mark Kirchner at 2007-11-11 23:52:04 >
# 3 Re: Grid Control - Individual Row Background Color
If the code you posted for setting the DynamicBackcolor is accurate, the problem
is you don't have the correct number of close-parenthesis.
Depending on the error-handler settings in effect, you may get a message
about an invalid setting for DynamicBackColor, or you get no message at all.
When you have an illegal expression in the Dynamic* properties, it will use
the default values, and you may also notice a dramatic slow-down in the speed
that the grid is displayed.

"Mark Kirchner" <markkirchner@lvcm.com> wrote:
>I don't think so. I tried using the example they give in the help, and I
can
>alternate colors using the example code as follows:
>
>frmMyForm.grdGrid1.SetAll("DynamicBackColor", ;
> "IIF(MOD(RECNO( ), 2)=0, RGB(255,255,255) , RGB(0,255,0))", "Column")
>
>but when I modify the example code with another embedded iif() statement,
it
>doesn't work. All rows are white.
>
>frmMyForm.grdGrid1.SetAll("DynamicBackColor", ;
> "IIF(dbfs.field_type='C', RGB(255,255,255), IIF(field_type='N',
>RGB(255,0,0), RGB(0,255,0))", "Column")
>
>Mark
>
><Tamar E. Granor> wrote in message
>news:inivavgior62vsrs5eioqu3phmui0dkqpn@4ax.com...
>> On Tue, 29 Apr 2003 19:20:59 -0700, "Mark Kirchner"
>> <markkirchner@lvcm.com> wrote:
>>
>> >I need to be able set/control the back color of each row in a grid
>> >individually. I am currently using the flexgrid control but this is too
>slow
>> >as I can't bind the data to the control(at least not that I know of),
and
>> >therefore have to manually insert each row from the data source and set
>the
>> >properties and colors appropriately. I can actually see the screen
>painting
>> >and once the record count hits more than 20, it's too slow.
>> >
>>
>> Can you do what you need with the DynamicBackColor property?
>>
>> Tamar
>
>
Brian Wallpe at 2007-11-11 23:53:00 >