Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SetAll and DynamicBackColor problem
Message
From
27/09/2005 15:47:05
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01052066
Message ID:
01053625
Views:
7
Multiple grids wouldn't matter. Two grid classes File #9361
Cetin

>Cetin,
>
> Thanks, I do have it working satisfactorily now. It wasn't a simple matter, because it actually involved three grids, on two different tabs of a pageframe, and they were interdependent. I needed to be able to refresh their data sources and reset the highlight, even when I wasn't actually in one of the grids or on the tab page. So I was running into various problems. But I got it all worked out!
>
>Dana
>
>>>I am trying to get this to work. The syntax works in another form, but on this one I keep getting the message "Expression is invalid. Use a valid expression for DYNAMICBACKCOLOR property." The strange this is that if I step through it, I don't get the message, only when it just runs. This code is in the AfterRowColChange event. vSbvPromoDestinations is a view, if that makes a difference. I am trying this because I have a few grids on the form, on one tab I have two grids, the lower being dependent on the upper. When swithcing between them, when I move the record pointer on the upper grid, the view controlling the other grid is requeried and the grid refreshed, but the record marker doesn't move. So I thought I'd get rid of it and use this.
>>>
>>>
>>>WITH This
>>>	.Tag = STR(RECNO('vSbvPromoDestinations'))
>>>
>>>	.SetAll("DynamicBackColor", "IIF(RECNO('vSbvPromoDestinations') = VAL(ALLTRIM(.Tag)), ;
>>>		RGB(255,255,128), RGB(255,255,255))", "Column")
>>>
>>>	.Refresh()
>>>*.colAirportCode.DynamicBackColor = RGB(0,128,255)
>>>ENDWITH
>>>
>>>
>>>Please help, it's driving me nuts!
>>>
>>>Thanks,
>>>Dana
>>
>>Dana,
>>I think you already solved this. Anyway if not:
>>1) val(alltrim(THIS.tag)) - THIS is mandatory there. It's part of the expression. Error message is due to that.
>>2) Do "SetAll" once (anywhere - typical places are grid.init or form.init)
>>This is simple current row hihglighting. However you need a little touch for it to work right:
>>
>>*Grid.BeforeRowColChange
>>lparameters nColIndex
>>thisform.LockScreen = .t.
>>
>>*Grid.AfterRowColChange
>>lparameters nColIndex
>>this.Tag = str(recno())
>>thisform.LockScreen = .f.
>>
>>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