Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DynamicBackColor
Message
De
17/11/1997 11:38:46
 
 
À
17/11/1997 11:33:35
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00060641
Message ID:
00060686
Vues:
35
>>>>>>>>>I had an IIF statement in the dynamicBackcolor property of a grid that wasn't working correctly. So I started to try and figure out what was wrong and then realized I can't get the DynamicBackColor to work at all for me. I must be doing something wrong...I have ="rgb(255,0,0)". I've tried it with and without the quotes.
>>>>>>>>
>>>>>>>>DynamicBackColor usually includes IIF function, e.g.:
>>>>>>>>**** Grid.Init event
>>>>>>>>cLine1="IIF(recno="+this.tag+",16711680,8421376)"
>>>>>>>>this.SetAll("DynamicBackColor",cLine1,"Column")
>>>>>>>
>>>>>>>Hi Edward,
>>>>>>>
>>>>>>>I put the following line in the grid's init event:
>>>>>>>
>>>>>>>cLine1="IIF(schedule.sch_absent = .t., rgb(255,0,0), rgb(0,255,0))"
>>>>>>>this.SetAll("DynamicBackColor",cLine1,"Column4")
>>>>>>>
>>>>>>>But the column's BackColor is still white do you see anything else that I am doing wrong?
>>>>>>>
>>>>>>>Paul
>>>>>>
>>>>>>For column4 only use:
>>>>>>This.Column4.Dynamicbackcolor="IIF(schedule.sch_absent=.t.,255,65280)"
>>>>>
>>>>>I did exactly that...still doesn't work.
>>>>>This blows my mind.
>>>>>
>>>>>Any other ideas?
>>>>
>>>>It should work. The last thing to check is to make sure that you don't have spaces in "IIF....", i.e issue also
>>>>This.Column4.Dynamicbackcolor=alltrim(This.Column4.Dynamicbackcolor)
>>>
>>>This didn't work either...it seems to me that something is keeping the DynamicBackColor from ever being evaluated.
>>
>>Sorry, I don't see how to help here. You probably could make some quick tests with Dynamic properties to get familiar with them...
>
>A funny thing about the dynamic properties... if you put together a statement wrong, (leave out a comma or something) they often don't whine when you try to run them, they just don't work. When I run into problem like this (I recently had to work through this problem with a 4-level nested IIF statement), I build the statement from the easiest possible syntax;
>"IIF(.T.,RGB(0,0,0),RGB(255,255,255))"
>and if this works, cut and paste from there.
>Do you have any column dynamic code that DOES work? If so, cut it from that grid, paste it into the unruly grid, and replace the condition with .T.. Does it work? If so, look carefully for the differences in code. I have had situations before that the ONLY way I could get my dynamic property code to work was cut and paste from known operational code. Don't ask me why, it's just that those properties are _very_ finicky. Good luck.

I agree with this, and would add one more thing. The last way to test is to move 'Dynamic' stuff from Init to AfterRowColumnChange and issue Grid.Refresh as much as possible.
Edward Pikman
Independent Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform