Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Field colors in grid
Message
From
16/08/2000 07:33:34
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
15/08/2000 17:58:47
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00396925
Message ID:
00405399
Views:
12
>>>>
*Grid.init
>>>>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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform