Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dynamic Grid Colors
Message
De
05/09/2002 10:12:59
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
05/09/2002 08:55:37
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00697013
Message ID:
00697047
Vues:
22
>Hello All...
>
>I was playing around with the DynamicBackColor property in a Grid and have managed to get the columns to alternate colors between rows depending on the RECNO(). Is there a way, and what would the syntax be for updating the color of a row based on values in each record. I would also like to assign a new color to a row if any of the text boxes in that row are clicked by the user. Any input would be helpful. Thanks in advance.
>
>Baron Morvant

Baron,
Just like recno() expression. ie: If you want to set all row to blue if myField value is 'Baron' then your expression would be like :

this.Setall('DynamicBackcolor', ;
'iif(myAlias.myField="Baron",rgb(0,0,255),rgb(255,255,255))')

If your expression gets a bit complex then use a method instead (it's easy to write complex expressions wrong and Dynamic* wouldn't error). ie:
*Grid.init
for each oCol in this.Columns
 oCol.DynamicBackcolor = "(thisform.GetMeColor('"+oCol.Controlsource+"'))"
endfor

* Form.Getmecolor
lparameters tcControlSource
do case
  case lower(tcControlsource) == 'somealias.somefield' ;
    and eval(tcControlsource) = 'SomeValue'
    return 0xFFFF00
  case Soemthing
    ....
  otherwise
    return 0xFFFFFF
endcase
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform