Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grids
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Titre:
Re: Grids
Divers
Thread ID:
00508642
Message ID:
00508652
Vues:
20
Hi!

You can program this in VFP using native grid.
For back colors:
The record source of the grid should contain additional field for each column of grid. This field holds the current value of the cell color. For each column, put an expression in the DynamicBackColor property. For example, for column 1 it will be like following:
MyRecordSource.ColorField1 - for first column
...

Than organize color change. In the rightclick event of the text box in the grid column put code:
lcColor = getcolor()
if lcColor>-1 && not cancelled
  replace MyRecordSource.ColorField1 with 
endif
the main thing now is to prepare the record source. It could be a cursor created by CREATE CURSOR, or a result of the SELECT statement opened using 'USE (DBF("SelectResultAlias")) IN 0 AGAIN ALIAS MyRecordSource'. In the SELECT statement put empty expressional fields to prepare fields for colors storing for each column.

If you want to change otehr colorsand attributes, well, the number of columns in the cursor will grow too quickly to fit into the limitation of max 255 columns in the VFP cursor. If this happen, you will require to combine the values into a single column appearance field using comma to separate them, for example. It will work slower than because DynamicBackColor and other properties of the column required to be set to the expression that extracts values from the column appearance field.

>hi
>does anybody know of a grid control which allows you to change the backcolor or any color of each cell.
>
>thanks
>
>daryl
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform