>>>>
>>>>for each oColumn in this.Columns
>>>> if type(oColumn.Controlsource)='L'
>>>> oColumn.DynamicBackcolor = ;
>>>> 'iif('+oColumn.Controlsource+',rgb(0,255,0),rgb(255,0,0))'
>>>> endif
>>>>endfor
Cetin
>>>
>>>
>>>Thanks,
>>>
>>>Sorry for the delay, have been away for some time (vacation)
>>>I've tried it, but could not get it to work, are there some other settings needed?
>>>
>>>Marc
>>
>>
Marc,
>>I assumed controlsources had logical type and Y-N is shown through inputmask. If that's not the case then code needs modification.
>>Cetin
>
>Sorry, for being not very clear.
>The controlsource IS indeed a logical type, but in the grid i use the checkbox to modify it.
>So 'Y' or 'N' is not shown.
>My intension was, when the user clicks it to .T. (Y) the background of the field, (the part where the text was (check?)) had to change to green.
>When .F. (N) is shoud be red.
>
>Marc.
Then probably caption is 'none'. Still this code works. If what you want is to color the box then instead of dynamicbackcolor use checkbox properties Style, DownPicture and Picture. ie: Assuming you have a bitmap named 'true.bmp' with a check on green background and 'false.bmp' with an empty box on red background :
Grid.Columns(n).Sparse = .f.
Grid.Columns(n).CurrentControl='myCheck1'
myCheck class based on checkbox properties :
DownPicture = 'true.bmp'
Picture = 'false.bmp'
Style = 1 && Graphical
Cetin