Home > Archive > Programming with dBASE > October 2005 > Setting individual row color in a grid









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 Setting individual row color in a grid
Ron

2005-10-28, 9:23 am

I am developing a order entry system in dBase Plus 2.6 to replace an old DOS based clipper application. The system displays today’s orders and current status using the grid class. To mimic the old system I would like to color the individual rows based on
the status field in the rowset. I have tried setting the grid’s colorNormal parameter with both code blocks and methods and always receive a “Data type mismatch. Expecting: Character” error message.

Is there a way to make this work?

Thanks,
Ron
Marc Hamelin

2005-10-28, 9:23 am

> Is there a way to make this work?

Yes, take a look at the beforeCellPaint() event in the OLH. I think you'll
need to set the editorControl's colorNormal value for each column.

Marc Hamelin


Ron

2005-10-28, 11:23 am

Thanks, I knew it had to be something simple that I was overlooking.

Marc Hamelin Wrote:

>
> Yes, take a look at the beforeCellPaint() event in the OLH. I think you'll
> need to set the editorControl's colorNormal value for each column.
>
> Marc Hamelin
>
>


Paul Van House

2005-10-31, 9:23 am

In article <3lgx#B82FHA.1352@news-server>, hd92flstf@prtcnet.com says...
> I am developing a order entry system in dBase Plus 2.6 to replace an old DOS based clipper application. The system displays today?s orders and current status using the grid class. To mimic the old system I would like to color the individual rows based o

n the status field in the rowset. I have tried setting the grid?s colorNormal parameter with both code blocks and methods and always receive a ?Data type mismatch. Expecting: Character? error message.
>
> Is there a way to make this work?
>
> Thanks,
> Ron
>

I think DBI is working on something that will change color for the
entire row. If you have a lot of data or columns, others have reported
the beforecellpaint method is rather slow if you want to color highlight
the entire row (works fine for one or two columns.) Plus, the OLH help
says beforecellpaint may not be the best solution to color one cell
based on another cell's value. (just a warning)

If you are just displaying data, I use an activeX product called
"simplegrid" which allows you to load data programmatically and color
rows or cells based on values.
You lose a little performance because you have to load the grid, but
once the data is in there you can sort by clicking on column headings
(no indexes necessary) and do many other "VB-like" things with the data.
With a little extra code you can update data and write it back to your
DBF table....but I use it primarily for data display.
--
Paul Van House
remove ".removeme" for e-mail replies
Radio/TV Software and Baseball Stat Software:
http://www.binxsoftware.com
Family Home Page: http://vanhouse.binxsoftware.com
Church Home Page: http://www.ashfordumc.org
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com