Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid DynamicBackColor
Message
 
À
18/12/1997 10:32:47
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00066890
Message ID:
00067180
Vues:
38
>>>>>>I have a grid in which I want every other line to be a different color. Using the example in VFP's help of using the MOD of RECNO() isn't practical. Is there a way I can do something like the MOD of the grids row numbers or does anyone else have another suggestion?
>>>>>
>>>>>IMHO, the best way is to add one more field into Grid.Recordsource and fill it with real backcolor property values. Then you just reevaluate DynamicBackColor property using this field value.
>>>>
>>>>I don't understand how this will help. Could you please elaborate? Thanks.
>>>
>>>Ok. Let say, you use cursor as Grid.Recordsource. This cursor will contain field 'rowbackcolor' populated with real color values different for each record, e.g. 16777215,0,12632256,etc. (see Backcolor property in Help). Now you just issue:
>>>cLine="gridcursor.rowbackcolor"
>>>this.setall("dynamicbackcolor",cLine,"column")
>>>And all rows get different color. Surely, it's applied for reasonably small cursors. If your recordsource is really big you better use RECNO().
>>
>>I get it. However, I don't think this is feasible for my grid. I want the rows to be white,grey,white,grey,etc... The data in the grid is highly manipulated changing the index order many times. This is the reason why I need an alternative to RECNO().
>
>How many tags you use? If you have let say 3 tags and 20 rows then you still can use this approach.

I may me misunderstanding your point so please verify if what I say here is true. If I have a field in my table that stores the Backcolor then every time an add or edit affects the index I will have to REPLACE the Backcolor for the current record and every record after it until EOF().

What I wish was available was row and column coordinates for the grid, which actually exist i.e. ActivateCell(nRow,nCol), we just can't gain access to them to use them.
Colin Magee
Team Leader, Systems Development
Metroland Media Group Ltd.
Mississauga, Ontario, Canada

cmagee@metroland.com

Never mistake having a career with having a life.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform