Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DynamicBackColor in grid
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00469202
Message ID:
00469327
Views:
30
That works fine (you can obviously check it :) 2 grids cannot be active at the same time. As soon as one grid gets focus it's AfterRowColChange() event fires and updates the form property with the correct value.

nGridRecno can be a grid property (or, obviously, GridHighlighter property :).
But nothing is wrong if it is a form property, for example, if the row highlighting was the feature added at the last moment.

>Another obvious observation: how can Form hold in One property two Record Numbers simultaniously? :)
>
>nGridRecno should be a grid property, then.
>
>>Then that's your problem.
>>
>>This is because you use ThisForm.SetAll("DynamicBackColor... in both Grid.Init() instead of This.SetAll("DynamicBackColor...
>>
>>It would work fine if there is just one grid in the form, but if there are more - the second grid.Init() will override the Dynamic... properties for the columns in the first grid too, and you will have identical expressions relying on the same alias.
>>
>>THISFORM.SetAll will set the property for ALL the grids in the form.
>>On the contrary THIS.Setall will set them only for one grid in which INIT() it is issued.
>>
>>
>>>I didn't mention this, but I have TWO grids in ONE form. Does that have anything to do with that? Here it is again...
>>>
>>>--Grid1 Init--
>>>*ThisForm.SetAll("DynamicBackColor", ;
>>>* "IIF(RECNO('authtype') =ThisForm.nGridRecno, RGB(193,255,255),"+ ;
>>>* "RGB(255,255,255))", "Column")
>>>ThisForm.SetAll("DynamicBackColor", ;
>>> "IIF(RECNO('authtype') # ThisForm.nGridRecno, RGB(255,255,255),"+ ;
>>> "RGB(193,255,255))", "Column")
>>>
>>>--Grid1 AfterRowColChange--
>>>LPARAMETERS nColIndex
>>>ThisForm.nGridRecno = RECNO("authtype")
>>>This.Refresh()
>>>
>>>--Grid1 Refresh--
>>>DODEFAULT()
>>>
>>>now for the 2nd grid on the same form...
>>>
>>>--Grid2 Init--
>>>*ThisForm.SetAll("DynamicBackColor", ;
>>>* "IIF(RECNO('org') =ThisForm.nGridRecno, RGB(193,255,255),"+ ;
>>>* "RGB(255,255,255))", "Column")
>>>ThisForm.SetAll("DynamicBackColor", ;
>>> "IIF(RECNO('org') # ThisForm.nGridRecno, RGB(255,255,255),"+ ;
>>> "RGB(193,255,255))", "Column")
>>>
>>>--Grid2 AfterRowColChange--
>>>LPARAMETERS nColIndex
>>>ThisForm.nGridRecno = RECNO("org")
>>>This.Refresh()
>>>
>>>--Grid2 Refresh--
>>>DODEFAULT()
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform