Information générale
Catégorie:
Codage, syntaxe et commandes
>>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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement