Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DynamicBackColor in a Grid
Message
 
À
21/05/1997 14:56:24
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00033148
Message ID:
00033237
Vues:
44
>>I try to use the Arnon Gal-oz's Tip about color in grid.
>>I have a grid and an entry field for a rapid search in the grid like in FoxPro help dialog box (by index).
>>The search and reposition in the grid work but I have always the same error.
>>"Expression is invalid. Use a valid expression for DYNAMICBACKCOLOR (or DYNAMICFORECOLOR) property".
>>
>>The follow lines are the code I use :
>>
>>In a method ColorLine()
>>WITH ThisForm
>> .gdGrid.SetAll("dynamicbackcolor", "IIF(RECNO() = .nRecno, .GridBackColor, .gdGrid.BackColor)", "Column")
>> .gdGrid.SetAll("dynamicforecolor", "IIF(RECNO() = .nRecno, .GridForeColor, .gdGrid.ForeColor)", "Column")
>> .gdGrid.Refresh()
>>ENDWITH
>>
>>In the Form.Init()
>>WITH ThisForm
>> .GridBackColor = .gdGrid.column1.text1.SelectedBackColor
>> .GridForeColor = .gdGrid.column1.text1.SelectedForeColor
>>ENDWITH
>>I tried to store the result of GetColor() in GridBackColor and GridForeColor and the same error occurs.
>>
>>nRecno is an property of ThisForm who contains the last recno() found
>>
>>Thank for your help.
>>Stephan
>
>May be it will help. I just copied from workable grid.afterrorcolchange event.
>cLine1="IIF(tmpparts.recno="+this.tag+",16711680,8421376)" && tmpparts is grid rowsource
>this.SetAll("DynamicBackColor",cLine1,"Column") && I guess you had problem with data type.

something like this append to me and it was a trailling space after the IIF() commande make sure that you dont have space before or after your commande...

Hope this help
Rocky Boy...
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform