General information
Category:
Forms & Form designer
>I've used this quite extensively in a grid to get different background colours depending on the cell's value and it works quite well for me as in:
>MyColumn.dynamicBackcolor='iif(left('+f+',1)="S",rgb(220,255,220),'+;
> 'iif(left('+f+',1)="X",rgb(240,240,240),'+;
> 'iif(left('+f+',1)="L",rgb(210,240,255),'+;
> 'iif(left('+f+',1)="*",rgb(255,220,220),rgb+;
> (255,255,255)))))'
>where f is a string containing the field name.
>I think you may be running into a problem because of where you are placing your code - ie within the textbox valid vs in the grid init event as in both examples. The reason I used f in my example was because it involved 210 different fields.
so where do you place your code?
I've so far tried the textbox valid, the grid init and the grid refresh
>
>
>
>
>>>As Barbara pointed out, you can use DynamicForeColor (or DynamicBackColor). I've only just done this. I had an option group and textbox to do a search. In the textbox valid event I just put Grid.SetAll("DynamicBackColor","IIF(match_criteria,RGB(0,255,255),RGB(255,255,255))","Column"). That set the back color to CYAN for all matching rows. I had to do a lot of playing to get it right (moving quotes around, etc).
>>
>>
>>I've tried this and variations on it in the textbox valid, and various refresh methods - response = zilch! (even with your code cut and pasted into said textbox.)
>>
>>Is there some other property we need to set before this trick will work?
>>
>>Harry
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only