Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Make the whole row of the grid to use the same forecolor
Message
 
 
To
03/07/2001 12:09:01
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00525731
Message ID:
00526391
Views:
20
>Nadya,
>It's not a problem. Highlighted grid simply adds highlighting code w/o any further touches. If you want highlight for active cell and on entry :
>*Grid.When
>thisform.lockscreen=.t.
>*Grid.Init
>...
>this.Setall('Sparse',f.)
>Cetin

Really? What simple??? I'll try. Thanks a lot.
>
>
>>>Hi!
>>>
>>>Control in the active cell is displayed by the color of the main control in column. If column property Sparse is set to .F., the color of the main column control is displayed in the entire column and Dynamic* property expressions have no effect here except DynamicCurrentControl.
>>>
>>>What I want to say is to explain more Nick's suggestions about DynamicCurrentControl.
>>>There are solutions for sparse = .F. and for sparse = .T.
>>>
>>>With sparse=.T., you require to set up the colors of the main column control (usually textbox). Current cell colors for active cell are used from this control.
>>>Setting up this in GotFocus should work! I did met the same situation
>>
>> Hi Vlad,
>>
>> Yesterday I decided to dismiss the idea of using GH for this project and used Cetin's highlighted grid instead. I made it work to highlight the whole row and use the same forecolor for the whole row with GotFocus event of the textbox. The only little problem, that visially first the active cell get's highlighted and then the whole row. The same problem exists with Nick's class too.
>>
>> Thanks again for your suggestion.
>>
>>
>>when setting colors in GotFocus event makes no difference. After some investigation, I discovered code in my classes that set up colors too overriding whatever was set in the GotFocus event. Just check this out accurately.
>>>You can, of course, use DynamicCurrentControl in such case and have 2 controls in your column with different colores and use one or another depended on the status field. However, such grids work slower.
>>>
>>>With Sparse=.F. you require to have 2 different controls anyway. 1 is for current row and another for displaying all other rows. In DynamicCurrentControl property put the expression to call custom method. In custom method (it is called for each grid row refreshing) return the name of the control depended on the current row. For control that will be displayed in the row at the moment that procedure called, set colors properly. 2 controls are required because with sparse=.F. in case you use custom refreshing of control for each row VFP shows the appearance of the last visible row in current cell. In other words, after grid refresh finished, last control colors set are used for current cell.
>>>
>>>Thats all on this topic ;)
>>>
>>>Take a look also to the FAQ#8092 (Auto-link do not works??? Look here: How to make a grid appear like a list similar to list box), it might be useful because it shows read-only grid with current row highlighting and without any defects related to th current cell.
>>>
>>>HTH.
>>>
>>>>Hi everybody,
>>>>
>>>>I have a grid, in which I set dynamicforecolor for all columns depending on status field value, e.g.
>>>>
>>>>.setall('DynamicForeColor', "thisform.myforecolor(BldMstr."+thisform.AddrField+")", 'Column')
>>>>
>>>>It sets correctly the dynamic forecolor except for the active column. In other words, if I set dynamic forecolor to blue, all columns show blue forecolor, but the active one shows black. Is it possible to make it blue too?
>>>>
>>>>Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform